Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@ekzemplaro

Facebook の Graph API で 団体の情報を得る (go)

More than 3 years have passed since last update.

次のプログラムを go で書いてみました。
Facebook の Graph API で 団体の情報を得る

次のライブラリーを使います。
A Facebook Graph API SDK For Go.

get_info.go
// ---------------------------------------------------------------
//
//  get_info.go
//
//                  Feb/22/2018
// ---------------------------------------------------------------
package main

import (
    "fmt"
    fb "../facebook"
)

// ---------------------------------------------------------------
func main() {
    code :="shimotsuke.city.promo"
    user_token := "FG4EFFBgb938BAO2ouOc1235pjXC8YgsXZBYRnZB8nNvwZCP7dJDTXq7pRrZCVXDX4rmH9hvEZCUj8ZA2ihBlMKMoVWWwzaaRzI8tqA6zCAhgZB12idZCYxIxXNmC112GypCJlnsGdUgLLwAYp0PAQinfL3J123f6or2JYj65bt0QSp1umNabcfg"

    res, _ := fb.Get("/" + code, fb.Params{
        "fields": "id,name,about",
        "access_token": user_token,
    })

    fmt.Println("id:", res["id"])
    fmt.Println("name:", res["name"])
    fmt.Println("about:", res["about"])
}

// ---------------------------------------------------------------
Makefile
get_info: get_info.go
    go build get_info.go
clean:
    rm -f get_info
1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ekzemplaro
Python3,Node.js,Go,Nginx,RaspberryPi あたりがカバー範囲です。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?