How to find how many POSTS (not page) has a user liked on my facebook profile

随声附和 提交于 2019-12-12 01:33:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!