5

I am trying to get all the posts for a page by using

https://graph.facebook.com/PAGE_ID/feed

And it works like a charm. I can get all the info for each post except the like count.

The feed does return "likes" for each post, but it shows the like info for the first 25 likes. I cannot know the like count of a post.

The closest solution I found on the net is to set "summary=1" when requesting info of a post, e.g.

https://graph.facebook.com/POST_ID/likes?summary=1

This will return a summary field that shows the like count of this post, which is exactly what I need.

However, if this is the only way to solve the problem, I have to make additional network request for each post just for getting the like count. I could originally finish the job with only ONE network request, but now I have make 1+N times (number of posts in the page feed) of network requests.

I think I must be missing something. FB must have some way to get the like count embedded in the feed info. Just like the FB app or website, all posts show their like counts immediately, there is no way to make additional N times of network requests in order to get the like count for each post.

Hope someone can help. Thanks a lot in advance.

4

1 回答 1

0

最后,我发现有一种方法可以获取每个帖子的点赞数/评论数,同时拉动提要,而无需发出进一步的网络请求:

/url/feed?fields=likes.summary(1).limit(0)

不是很棒吗?

于 2016-01-09T10:35:27.013 回答