Is it possible to get the user likes and comments from facebook?
With the graph api, you can can do me/likes
, but that only returns the pages you liked, and I want all the likes. So also the url's, posts, pictures, ... I liked. The same for the comments.
Or is there a query to get the activity log from an user?
You can use the
like
table (https://developers.facebook.com/docs/reference/fql/like/)comment
table (https://developers.facebook.com/docs/reference/fql/comment/)to query for object comments and likes. Then, if you want to distinguish between object types (photo, album, event, group, note, link, video, application, status, check-in, review, comment, post
) for getting more info about the like or comment, you need to do queries like this for each object type:
select src, link from photo where object_id in (select object_id from like where user_id=me() and object_type="photo" limit 25)
For URL likes you can use
url_like
table https://developers.facebook.com/docs/reference/fql/url_like/You can use the Graph API. You have to fetch them with different end-points, like:
Get the posts with: /me/feed
- demo
Perms req: read_stream
Get the photos with: /me/photo
- demo
Perms req: user_photos
Now, to get the likes use this:
/likes?id={post_id|photo_id|url}
for comments:
/comments?id={post_id|photo_id|url}
You can test your calls in Graph API Explorer