LoginSignup
0
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2018-02-19

Graph API を curl で使う例です。

まず、フェースブックのページにアクセスします。
その団体の情報を得てみます。(ID を調べるのにも使えます。)

https://www.facebook.com/shimotsuke.city.promo/
facebook_feb1901.png

USER_TOKEN は、有効なものと置き換えて下さい。
"shimotsuke.city.promo" を変更すれば、色々な団体の情報が得られます。

get_info.sh
#
#   get_info.sh
#
#
#                                  Feb/19/2018
# 
URL="https://graph.facebook.com/v2.12/"
CODE="shimotsuke.city.promo"
#
USER_TOKEN="FG4EFFBgb938BAO2ouOc1235pjXC8YgsXZBYRnZB8nNvwZCP7dJDTXq7pRrZCVXDX4rmH9hvEZCUj8ZA2ihBlMKMoVWWwzaaRzI8tqA6zCAhgZB12idZCYxIxXNmC112GypCJlnsGdUgLLwAYp0PAQinfL3J123f6or2JYj65bt0QSp1umNabcfg"
#
FIELDS='id,name,about'
#
curl "$URL$CODE?fields=$FIELDS&access_token=$USER_TOKEN" | jq .
#

実行結果です。
facebook_feb1902.png

0
0
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
0
0