简体   繁体   English

如何使用图形API从Facebook页面获取最受欢迎的帖子

[英]How to get most popular posts from facebook page using graph API

I wanted to fetch most popular posts from a facebook page using Graph API. 我想使用Graph API从Facebook页面获取最受欢迎的帖子。 I tried https://graph.facebook.com/%pageId%/posts , But with that API I am getting recent posts from page. 我尝试了https://graph.facebook.com/%pageId%/posts ,但是使用该API,我收到了来自页面的最新帖子。 I wanted to filter the result with most popular posts (ie, most shared, liked and commented). 我想过滤最热门帖子的结果(即大多数共享,喜欢和评论)。 Can any body help me out how to get the popular posts from the page using the graph API. 任何正文都可以帮助我使用图形API从页面中获取热门帖子。

Thanks, Siva. 谢谢,西瓦。

You can't get popular posts directly from Facebook Graph API. 您无法直接从Facebook Graph API获取热门帖子。 You can fetch the posts using the Graph API (/{page-id}/posts) , then count likes, shares or comments of a post by yourself (/{post-id}/likes, /{post-id}/comments, /{post-id}/sharedposts) and then sort all the posts. 您可以使用图谱API (/ {page-id} / posts)获取帖子 ,然后自行计算帖子的喜欢,分享或评论(/ {post-id} / likes,/ {post-id} / comments ,/ {post-id} / sharedposts)然后对所有帖子进行排序。

References: 参考文献:

1. https://developers.facebook.com/docs/graph-api/reference/v2.3/object/comments 2. https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes 3. https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts 1. https://developers.facebook.com/docs/graph-api/reference/v2.3/object/comments 2. https://developers.facebook.com/docs/graph-api/reference/v2.3 / object / likes 3. https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts

Just an FYI, it seems FB is building out an API for this but it's very restricted right now, nobody can use it. 仅仅是一个FYI,似乎FB正在为此构建一个API,但它现在非常受限制,没有人可以使用它。

https://developers.facebook.com/docs/public_feed/ https://developers.facebook.com/docs/public_feed/

There is a "bug" in the documentation that suggests it is not currently possible to find out what the top liked URLs in your domain are via FQL or the Graph API. 文档中有一个“错误”,表明目前无法通过FQL或Graph API找出您网域中最受欢迎的网址。 I don't believe this is the case, as FB claims that the API is more robust than the dashboard. 我不相信这种情况,因为FB声称API比仪表板更强大。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM