问题
Is there a way to find out (or generate a count) of how many posts has a user 'liked' on my facebook profile?
For example, if I provide a userID, can I query that how many of the posts (on a particular facebook profile page) has this user liked?
回答1:
You should be able to use FQL for that.
The two FQL tables that are of interest here are:
- like - "returns the IDs of users who like a given object (video, note, link, photo, or album)"
- stream - "used to return a list of a stream posts"
You can then use them both like this:
SELECT
object_id
FROM
like
WHERE
user_id = USER_ID
AND
post_id IN (SELECT
post_id
FROM
stream
WHERE
source_id = PAGE_ID)
You'll need to have two permissions for the logged in user when you try this: read_stream and read_insights.
You can try it in the Graph Api Explorer (just replace the USER_ID and PAGE_ID with real ids)
来源:https://stackoverflow.com/questions/10203621/how-to-find-how-many-posts-not-page-has-a-user-liked-on-my-facebook-profile