facebookのプロフィール欄を取得し、卒論に利用できないかと考えています。アクセストークン取得まではどうにかできましたが、そのあとがうまくいきません。Githubにあったpython3のSDKを使い、exampleをそのまま実行したのですが、アプリのレビューをfacebookから受けてください、という旨のエラーが出ます。研究などのためにデータを取得することはできないのでしょうか?アプリを開発してレビューを受けないとデータは取得できないのでしょうか?
もしくは、アクセストークンの取得の際に取得したい項目をいろいろ選ぶのですが、それが関係していたりするのでしょうか?(現状適当に選んでいます)
詳しい方、ご教授いただけると幸いです。
実行したコード
""" A simple example script to get all posts on a user's timeline. Originally created by Mitchell Stewart. <https://gist.github.com/mylsb/10294040> """ import facebook import requests def some_action(post): """ Here you might want to do something with each post. E.g. grab the post's message (post['message']) or the post's picture (post['picture']). In this implementation we just print the post's created time. """ print(post["created_time"]) # You'll need an access token here to do anything. You can get a temporary one # here: https://developers.facebook.com/tools/explorer/ access_token = "#####" # Look at Bill Gates's profile for this example by using his Facebook id. user = "BillGates" graph = facebook.GraphAPI(access_token) profile = graph.get_object(user) posts = graph.get_connections(profile["id"], "posts") # Wrap this block in a while loop so we can keep paginating requests until # finished. while True: try: # Perform some action on each post in the collection we receive from # Facebook. [some_action(post=post) for post in posts["data"]] # Attempt to make a request to the next page of data, if it exists. posts = requests.get(posts["paging"]["next"]).json() except KeyError: # When there are no more pages (['paging']['next']), break from the # loop and end the script. break
エラー
Traceback (most recent call last): File "get_posts.py", line 25, in <module> profile = graph.get_object(user) File "C:\Users\###\Anaconda3\lib\site-packages\facebook\__init__.py", line 135, in get_object return self.request("{0}/{1}".format(self.version, id), args) File "C:\Users\###\Anaconda3\lib\site-packages\facebook\__init__.py", line 322, in request raise GraphAPIError(result) facebook.GraphAPIError: (#10) To use 'Page Public Content Access', your use of this endpoint must be review ed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.
あなたの回答
tips
プレビュー