fuc*_*777 18 facebook count facebook-graph-api facebook-comments
似乎Facebook改变了帖子的结果,几周前就可以直接从帖子中读取评论数
https://graph.facebook.com/125909647492772_502974003098530
你有类似的东西
...
"comments": {
"data": [
{
"id": "502974003098530_78616446",
"from": {
"name": "Mathias Fritz",
"id": "526559276"
},
"message": "saugeil!",
"can_remove": false,
"created_time": "2013-03-26T14:58:01+0000",
"like_count": 1,
"user_likes": false
}
],
"paging": {
"cursors": {
"after": "MQ==",
"before": "MQ=="
}
},
"count": 1
Run Code Online (Sandbox Code Playgroud)
但现在计数丢失了.
我对图表文档进行了一些研究,但是这个方向的唯一变化似乎是注释现在可以有注释......而这些注释会在名为comment_count的字段中计算.
是否仍有办法获得总评论数?
小智 30
要获得计数,最后添加?summary = 1:https://graph.facebook.com/125909647492772_502974003098530/comments ?summary=1
Shi*_*ade 20
我遇到了同样的问题,只是添加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
如果需要,您还可以添加其他参数; 由a隔开,
Abh*_*oel 14
summary=true 是你在找什么
得到喜欢的数量:
114916098537132_1265715836790480/likes?summary=true
Run Code Online (Sandbox Code Playgroud)
获得评论数
114916098537132_1265715836790480/comments?summary=true
Run Code Online (Sandbox Code Playgroud)
获得股票数量:
114916098537132_1265715836790480?fields=shares
Run Code Online (Sandbox Code Playgroud)
最后[结合所有3]
114916098537132_1265715836790480?fields=shares,likes.summary(true),comments.summary(true)
Run Code Online (Sandbox Code Playgroud)
改进版本 (添加限制(0)以删除喜欢列表并获取摘要):
114916098537132_1265715836790480?fields=shares,likes.limit(0).summary(true),comments.limit(0).summary(true)
Run Code Online (Sandbox Code Playgroud)
这对我很有效:
fields=shares,created_time,comments.summary(true).limit(0)
Run Code Online (Sandbox Code Playgroud)
这将返回评论计数并summary同时返回 0 条评论,这是完美的,因为您只需要评论计数。
您可以通过FQL获得总评论数.请参阅以下问题作为参考:
这是您需要的查询: SELECT comment_info FROM stream WHERE post_id = ...
| 归档时间: |
|
| 查看次数: |
33625 次 |
| 最近记录: |