Use Facebook GraphAPI or FQL to get Facebook activ

2019-06-13 19:01发布

I can explore my activity log using browser (https://www.facebook.com/help/437430672945092)

I wants to write a app to analyze my facebook data.

Is there any way to get my activity log using GraphAPI or FQL?

1条回答
别忘想泡老子
2楼-- · 2019-06-13 19:39

This is possible, but not via a single request of query. It's neccessary to use a combination of both Graph API requests, as well as FQL queries. You'll need the appropriate Access Token Permissions to do this.

All of your Posts:

https://graph.facebook.com/me/posts?since=UNIX_TIMESTAMP&access_token=YOUR_ACCESS_TOKEN

All of your OpenGraph Actions. This can get lengthy, see the list at https://developers.facebook.com/docs/reference/opengraph Example for the og.likes:

https://graph.facebook.com/me/og.likes?since=UNIX_TIMESTAMP&access_token=YOUR_ACCESS_TOKEN

For custom OpenGraph Actions, you have to create the queries depending on the definition of the Actions. See docs here https://developers.facebook.com/docs/opengraph/using-objects#read Sample for Foursquare Checkins:

https://graph.facebook.com/me/playfoursquare:checkin_to?since=UNIX_TIMESTAMP&access_token=YOUR_ACCESS_TOKEN

All of your Object Likes (FQL):

select object_id from like where user_id = me()

All of your URL Likes (FQL):

select url from url_like where user_id = me()

All of your Page Likes (FQL):

select page_id, name, categories from page where page_id in (select page_id from page_fan where uid = me())

I'm sure that I forgot some, but I think the message is here that it's not really simple and there's not a "all-in-one" query which can do what you want to achieve.

查看更多
登录 后发表回答