我只是想使用 Facebook 的 python api 获取我 friend 的生日
我尝试了 https://developers.facebook.com/tools/explorer/ 中的查询与“me/friends?fields=birthday”,工作正常,但在我的Python代码中,它显示“GraphAPIError:必须使用事件访问 token 来查询有关当前用户的信息。”
我在这里发布了我的代码:
import facebook
token = 'a token' # token omitted here, this is the same token when I use in https://developers.facebook.com/tools/explorer/
graph = facebook.GraphAPI(token)
fb = graph.request("me/friends?fields=birthday")
# while graph.request("me/friends") works well
print fb
有人帮忙吗?
最佳答案
实际上,这有效......
args = {'fields' : 'birthday,name' }
friends = graph.get_object("me/friends",**args)
奇怪
关于python - facebook 使用 python 获取 friend 的生日,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19761091/