LoginSignup
1
1

More than 5 years have passed since last update.

Facebook の Graph API で自分の投稿を取得する (go)

Posted at

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

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

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

func main() {
    fmt.Printf ("*** 開始 ***\n")

    res, _ := fb.Get("/me/posts", fb.Params{
        "access_token": "FG4EFFBgb938BAO2ouOc1235pjXC8YgsXZBYRnZB8nNvwZCP7dJDTXq7pRrZCVXDX4rmH9hvEZCUj8ZA2ihBlMKMoVWWwzaaRzI8tqA6zCAhgZB12idZCYxIxXNmC112GypCJlnsGdUgLLwAYp0PAQinfL3J123f6or2JYj65bt0QSp1umNabcfg",
        })

    fmt.Println("0:", res.Get("data.0"), "\n")
    fmt.Println("1:", res.Get("data.1"), "\n")
    fmt.Println("2:", res.Get("data.2"), "\n")
    fmt.Println("3:", res.Get("data.3"), "\n")
    fmt.Println("4:", res.Get("data.4"), "\n")

    fmt.Printf ("*** 終了 ***\n")
}

// ---------------------------------------------------------------
Makefile
get_posts: get_posts.go
    go build get_posts.go
clean:
    rm -f get_posts
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