[英]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.