在此之前(5-6个月前),在https://graph.facebook.com/me/home?limit=20&access_token=MY_ACCESS_TOKEN&format=json的请求下,我收到了20个json格式的Facebook提要,每个提要都包含了赞和评论。
但现在我没有得到喜欢和评论的回应。只有这一部分在回应中缺失了。
请告诉我为什么我现在不算了?如果Facebook改变了他们的API,那么是否可以通过修改或添加一些参数来获得相同请求中的计数呢?如果不是,那我该做什么。
发布于 2013-11-21 17:31:57
我得到了解决方案,只需在“字段”中添加likes.summary(true),comments.summary(true)参数就可以了。
我用了https://graph.facebook.com/me/feed?access_token=ACCESS_TOKEN&fields=story,from,story_tags,likes.summary(true),comments.summary(true)
而不是https://graph.facebook.com/me/feed?access_token=ACCESS_TOKEN
如果需要,还可以添加其他参数;
此外,如果您希望计算单个帖子,则可以使用
https://graph.facebook.com/POST_ID/likes?summary=true&access_token=ACCESS_TOKEN喜欢计数
或
https://graph.facebook.com/POST_ID/comments?summary=true&access_token=ACCESS_TOKEN点评
https://stackoverflow.com/questions/20105149
复制相似问题