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
0
Help us understand the problem. What is going on with this article?
@ekzemplaro

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

More than 3 years have passed since last update.

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
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,PHP,Nginx,RaspberryPi あたりがカバー範囲です。

Comments

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