Getting from Facebook API total number of likes per post

血红的双手。 提交于 2019-12-12 01:02:20

问题


I'm working with the following Facebook API endpoints: /statuses, /links, /photos For each returned object I'm only getting likes and comments objects which display top25 results, and a pagination that leads to the next 25.

I'm only interested in the number of likes. Is there a way to get that number through a different API call which doesn't require multiple pagination calls?


回答1:


You can return the total number of likes for various objects using FQL. Here's the documentation for how to get the total number of likes for a comment:

https://developers.facebook.com/docs/reference/fql/comment

The query itself would look like this:

SELECT likes FROM comment WHERE post_id = xyx




回答2:


SELECT like_info.like_count FROM stream WHERE source_id = '<id>'

or

SELECT like_info.like_count FROM stream WHERE source_id = '<id>' and and actor_id = '<id>'

More: https://developers.facebook.com/docs/reference/fql/stream/



来源:https://stackoverflow.com/questions/15684318/getting-from-facebook-api-total-number-of-likes-per-post

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