1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

次のプログラムを 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
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?