附有一个问题...... 我尝试使用所有Feed喜欢和评论在一段时间内检索页面。或..实际上我只需要总体喜欢和评论的总数。
到目前为止......
$user_pages = $facebook-> api ('/ me / accounts');
...
$page_feeds = $facebook-> api ("/". $ page_name ['id']. '/ feed', 'GET', array ('limit' => 10000, 'since' => mktime (0,0, 0, date ("m"), 1, date ("Y"))));
...
foreach ($page_feeds ['data'] as $ page) {
$c = $facebook-> api ("/" $ page ['id'] "/ likes", "GET", array ('limit' => 10000)..);
$temp ['likes'] = count ($ c ['data']);
$c = $ facebook-> api ("/" $ page ['id'] "/ comments", "GET", array ('limit' => 10000)..);
$temp ['comments'] = count ($ c ['data']);
}
.....
因此,我获得了我所管理的所有页面,然后所有页面都从本月的第一天开始提供给页面。这种情况一直持续到答案存在为止。但问题是我最多只能获得25次Likes和评论。 (API文档中描述的“计数”一词,但我在这里遗漏了。
所以现在我必须在循环中调用所有喜欢和评论然后获取数字。
这些查询现在需要三分钟......这显然太长了......
这不是很好的方式吗?我能找到任何东西。 我希望我这个查询
$page_feeds = $ facebook-> api ("/". $ page_name ['id']. '/ feed', 'GET', array ('limit' => 10000, 'since' => mktime (0,0, 0, date ("m"), 1, date ("Y"))));
可以调整,然后所有喜欢和评论(或至少数字)得到
150769909716/feed?fields=likes.limit(10000).fields(id),comments.limit(10000).fields(id)&limit=10000&since=1372608000
不幸地给了我最多只有25个喜欢和评论。
蒂莫
#编辑:
https://graph.facebook.com/[pageid]/feed?fields=likes.limit%2810000%29.fields%28id%29,comments.limit%2810000%29.fields%28id%29&locale=de_DE&since=1372608000&limit=10000&access_token=yyyy
告诉我:
{
"data": [
{
"id": "xxx_xxx",
"created_time": "2013-07-23T07:08:25+0000",
"likes": {
"data": [
{
"id": "xxxx"
},
],
"paging": {
"cursors": {
"after": "xxx",
"before": "xxxx"
},
"next": "xxxx"
}
},
https://graph.facebook.com/[pageid]/feed?since=1372608000&limit=10000&access_token=yyyy
给我:(是的,我的伯爵在那里......但只有浏览器电话)
"likes": {
"data": [
{
"name": "xxx",
"id": "xxx"
},
],
**"count": 53**
},
每次调用的同一次调用给出了没有Count数据的结果....
答案 0 :(得分:1)
不幸的是,当您查看帖子时,Facebook已经删除了您已经看到的喜欢和评论的总数。相反,您需要为每个帖子再次调用以检索总喜欢或评论。 他们还将其从计数重命名为 total_count
示例:
喜欢
https://graph.facebook.com/POST_ID/likes/?summary=true
它将返回类似这样的内容
{
"data": [
{
"id": "xxxx",
"name": "xxxxx"
},
{
"id": "xxxx",
"name": "xxxxx"
},
{
"id": "xxxx",
"name": "xxxxx"
},
{
"id": "xxxx",
"name": "xxxxx"
}
],
"paging": {
"cursors": {
"after": "NTU2MTU3NjU0",
"before": "MTA4OTM4NzgwMA=="
}
},
"summary": {
"total_count": 4
}
}
征求意见:
https://graph.facebook.com/POST_ID/comments/?summary=true
{
"data": [
{
"id": "xxxxx",
"from": {
"category": "Media/news/publishing",
"category_list": [
{
"id": "xxxxxx",
"name": "xxxx"
},
{
"id": "xxxxxx",
"name": "xxxx"
}
],
"name": "xxxxx",
"id": "xxxxx"
},
"message": "xxxxxxx",
"can_remove": false,
"created_time": "2013-07-03T20:36:54+0000",
"like_count": 0,
"user_likes": false
}
],
"paging": {
"cursors": {
"after": "Mg==",
"before": "Mg=="
}
},
"summary": {
"order": "ranked",
"total_count": 2
}
}