Graph API的搜索返回相当少于Facebook用户面临搜索的公开帖子? [英] Graph API's search returning considerately less public posts than Facebook's user facing search?

查看:163
本文介绍了Graph API的搜索返回相当少于Facebook用户面临搜索的公开帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Graph API开发基于Facebook数据的应用程序。功能的一部分需要搜索Facebook的公开帖子,基本上与Facebook在www.facebook.com/search相同的方式:



http://www.facebook.com/search/results.php ?q =感恩节& type = eposts& init = quick& tas = 0.31611707084812224



然而,当我通过Graph API发布相同的搜索结果时返回错过标准用户界面中显示的许多帖子。标准搜索返回的许多最近的帖子都丢失(将access_token替换为您所拥有的):





有没有人有什么想法可以导致这个,我可以如何解决它?我有客户质疑我的应用程序的质量,因为这个差异。



非常感谢,
Boaz

解决方案

这是因为Graph API使用分页,如果它返回太多的对象,如果你看看Nike搜索的响应的底部,你会发现: / p>

 分页:{
previous:https://graph.facebook.com/search?q = nike& type = post& access_token = XX& limit = 25& since = 1322257702& __ previous = 1,
next:https://graph.facebook.com/search?q=nike&type = post& access_token = XX& limit = 25& until = 1322246079
}

向下一个网址发出另一个请求,以获取更多结果。


I'm developing an application based on facebook's data using the Graph API. Part of the functionality entails searching Facebook's public post, essentially in the same fashion that Facebook does on www.facebook.com/search:

http://www.facebook.com/search/results.php?q=thanksgiving&type=eposts&init=quick&tas=0.31611707084812224

However, when I issue the same search via the Graph API, the results return miss many of the posts shown in the standard user interface. Many of the most recent posts returned by the standard search are missing (replace the access_token to the one you have):

https://graph.facebook.com/search?q=thanksgiving&type=post&access_token=XXXX

Does anyone have an idea what can cause this and how I can work around it? I have customer questioning the quality of my application because of this difference.

Many thanks, Boaz

解决方案

That is because the Graph API uses pagination if it returns too many objects, if you take a look on the bottom of the response of the "Nike" search you will find this:

"paging": {
      "previous": "https://graph.facebook.com/search?q=nike&type=post&access_token=XX&limit=25&since=1322257702&__previous=1",
      "next": "https://graph.facebook.com/search?q=nike&type=post&access_token=XX&limit=25&until=1322246079"
   }

Just make another request to the "next" url in order to fetch more results.

这篇关于Graph API的搜索返回相当少于Facebook用户面临搜索的公开帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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