简体   繁体   English

facebook api获得包含> 2条评论或> 4个赞的完整帖子

[英]facebook api getting full posts with > 2 comments or > 4 likes

when I make the user/feed request on the Facebook Open Graph API, I get a feed object where posts with > 2 comments or > 4 likes don't reveal the detailed information for those specific comments. 当我在Facebook Open Graph API上发出用户/提要请求时,我得到了一个提要对象,其中带有> 2条评论或> 4个点赞的帖子不会显示这些特定评论的详细信息。

I am using https://github.com/Thuzi/facebook-node-sdk to make requests but it is very similar to the 'request' NodeJS library. 我正在使用https://github.com/Thuzi/facebook-node-sdk发出请求,但它与“请求” NodeJS库非常相似。

I can get the full posts individually by making a separate request for that post's Open Graph ID, but this doesn't lend itself to fun code because requests are asynchronous and nesting more asynchronous calls within asynchronous calls doesn't lend itself to fun code. 我可以通过单独请求该帖子的Open Graph ID来单独获取完整的帖子,但这并不能使代码本身变得有趣,因为请求是异步的,并且在异步调用中嵌套更多的异步调用不会使自己变得有趣。

Any way I can obtain the full posts? 有什么办法可以获取完整的帖子?

Any way I can obtain the full posts? 有什么办法可以获取完整的帖子?

You could use the (relatively) new Field Expansion feature, to set your own limit for likes and comments, like this: 您可以使用(相对)新的字段扩展功能,为喜欢和评论设置自己的限制,如下所示:

/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)

If you expect (and need) more likes/comments, you might have to set the limits to higher values. 如果你希望(和需要)更多的喜欢/评论,您可能需要设置的限制,以更高的价值。

But warning, these queries can be quite time-consuming – I just tried the one shown using the Graph API Explorer, and it froze my browser for quite some time. 但是警告一下,这些查询可能会非常耗时–我只是使用Graph API Explorer尝试了显示的查询,它冻结了我的浏览器一段时间。 (Although that's partliy the Explorers fault, because it manipulates the data heavily before displaying it. Making the pure request against the API, https://graph.facebook.com/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)&access_token=… , shows to be quicker.) (尽管这部分是Explorer的错误,因为它在显示数据之前会大量处理数据。针对API发出纯请求, https://graph.facebook.com/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)&access_token=… //graph.facebook.com/facebook/feed?fields = story,message,likes.limit https://graph.facebook.com/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)&access_token=… ,示出了要快。)

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

相关问题 facebook图表API端点,用于获取帖子的“赞,分享,评论” - facebook graph API endpoint for getting “likes, shares, comments” for post(s) 逐步获得页面帖子和评论赞的API - API to incrementally get likes on page posts and comments Facebook API:我们可以分别知道点赞,帖子,分享,评论的数量吗? - Facebook API : Can we know the number of likes, posts, shares, comments individually? 如何在不使用FQL的情况下将Facebook Graph API限制为仅由用户发布(而不是评论或喜欢)? - How to limit Facebook Graph API to only posts (not comments or likes) by user without using FQL? 如何使用Graph API获取每个粉丝的喜欢计数,Facebook页面上帖子的评论 - How to get count of each fan's likes, comments for posts on Facebook page using Graph API Facebook API-检查帖子的赞和评论 - Facebook API - Check Likes and Comments of Post Facebook API Restserver错误,带有喜欢和评论 - Facebook API restserver error with likes and comments Facebook Graph API不返回喜欢的帖子 - Facebook Graph API not returning posts likes 移动应用帖子的Facebook洞察中的空洞故事点击,喜欢和评论 - Empty story clicks, likes and comments in Facebook insights for mobile app posts 有效地检索Facebook帖子(PHP)上的点赞/分享/评论 - Efficiently retrieve likes/shares/comments on facebook posts (PHP)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM