Facebook Graph API分页没有给出确切的结果? [英] Facebook Graph API pagination is not giving the exact result?

查看:98
本文介绍了Facebook Graph API分页没有给出确切的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Graph API来获取特定查询的数据。

I am using the Graph API to fetch data for a specific query.

function getFeed($access_token,$until)
{
  $result = $this->facebook->api(
    '/me/home', 
    'GET', 
    array(
      'access_token' => $access_token,
      'limit' => 5,
      'until' => $until
    )
  );
  return $result;
}

我通过jQuery调用此函数,并在每次调用中获取5个帖子。但是,在三到三个电话之后并没有给出确切的结果。比前一天三天前(例如1天前直接指导4天前,例如今天是星期二,所以周二的饲料会比星期一跳过,直接跳到周日的饲料)。然后它将停止提供数据并给出空白的结果。

I'm calling this function through jQuery and fetch 5 post in every call. But it is not giving exact result after two-three calls. than It goes two-three days before(for e.g 1 day ago to direct 4 days ago , for e.g today is Tuesday so it will give feeds of Tuesday than it skips Monday and directly jump to Sunday's feed). And then it will stop giving data and give the empty result.

如果我将限制从5增加到25,那么它会给出一些什么准确的结果,但是会比我只有最后5天的帖子,而不是超过那个,然后它会给空的结果

If i increased the limit from 5 to 25 then it will give some what accurate result but than it will give me only last 5 days posts and not more than that and then it will give empty result


  1. 那么有什么限制有多少数据可以通过graph API获取?

  1. So is there any limit that how much data we can fetch at times with graph API?

是否可以在一次通话中获取更多帖子? (例如5到25或更多,那么)有什么区别吗?

Is it good to fetch more posts on one call ? ( for e.g from 5 to 25 or more that that) does it make any difference?

在Graph API中分页的最佳做法是什么?

Which is the best practice to paginate in Graph API?


推荐答案

关于第一个&第二个问题,

In regards to first & second question,

它不在文档中,但我个人对我的项目进行了测试。

Its not in documentation but personally I have tested following for my project.

Facebook limit 限于500个帖子。不管你的限制高于500,最多只能获得500个结果。尝试使用500(或更多),您将获得最大的职位。

Facebook limit is limited to 500 posts. No matter you put a limit higher than 500 it will fetch only 500 results max. Try with 500 (or more), you will get maximum posts.

您每次不会获得500个帖子,但一般会超过490个职位。
某些帖子由于各种原因(如隐私,被阻止的用户,不适合特定地区和其他情况)被过滤。

You wont get 500 posts every time but will get above 490 posts in general. Some posts get filtered by various reasons (like privacy, blocked user, not suitable for specific region and other things)

有关详细信息,请检查

For more details check Facebook Open Graph API: weird behavior of parameter limit while getting a paginated user's news feed

关于第三个问题,

http://developers.facebook.com/blog/post/478/

想要增加您对于图形API验证的了解 Facebook应用程序开发的图API实例

Want to increase your knowledge about graph api checkout Graph API examples for facebook application development

可能会帮助您。

这篇关于Facebook Graph API分页没有给出确切的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆