问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/8274444/graph-apis-search-returning-considerately-less-public-posts-than-facebooks-use