我怎样才能使用python代码和facebook graph api获得我所有的facebook帖子。 我已经尝试使用这个代码。
import json
import facebook
def get_basic_info(token):
graph = facebook.GraphAPI(token)
profile = graph.get_object('me',fields='first_name,last_name,location,link,email')
print(json.dumps(profile, indent=5))
def get_all_posts(token):
graph = facebook.GraphAPI(token)
events = graph.request('type=event&limit=10000')
print(events)
def main():
token = "my_token"
#get_basic_info(token)
get_all_posts(token)
if __name__ == '__main__':
main()
我得到一个错误,说。
"GraphAPIError: (#33) This object does not exist or does not support this action".
似乎所有其他的stackoverflow问题都很老了,不适用于最新版本的facebook graph API。我不完全确定你是否可以用facebook graph api来做这个。
如果使用这种技术不可能,有没有其他方法可以让我用python获得我的帖子?
请注意,函数get_basic_info()工作得很好。