Proper way to get all activities for a facebook user
I'm trying to find a way to get all the activities performed by a facebook user but what seems to be the proper method is not working. If I go to the Graph API Explorer I see that it is possible to make an activities call on a user (in this case 'me')
When I run the query, I find that it returns no data. 开发者_如何学编程
In order to rule out permissions, I've generated an access token that has permissions set to true for everything. I also should note that in the facebook UI on my timeline I do have activities. http://www.facebook.com/{your username}?sk=allactivity
Has anyone been able to make the activities call work? I noticed in the main Graph API page there is not mention of this specific call, or the Activities objects. Just wondering if this was something that was removed for some reason.
/activities
isn't the list of all activity, it's the list of activities a user is interested in, like soccer, programming, etc. For me, mine comes back as:
"data": [
{
"name": "Science",
"category": "Interest",
"id": "108196582538810",
"created_time": "2011-11-06T22:47:01+0000"
},
{
"name": "University of Utah",
"category": "Interest",
"id": "109293595757241",
"created_time": "2011-07-20T21:20:29+0000"
},
{
"name": "Soccer",
"category": "Sport",
"id": "102173226491776",
"created_time": "2011-02-06T00:13:58+0000"
},
{
"name": "Programming",
"category": "Interest",
"id": "101882226520576"
},
{
"name": "Travel",
"category": "Interest",
"id": "109592195726412"
}
]
I think you want the data from the stream table. Of particular use would be this query:
SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id = me()
More detailed docs here: https://developers.facebook.com/docs/reference/fql/stream/
精彩评论