Facebook graph api search results depends on location?

荒凉一梦 提交于 2019-11-30 15:32:36

问题


I've tried to fetch results using Graph search API and I've notice that the results when executed in my computer (Argentina) are different from the results when I run it in a server (France).

Is this like this? How can I force a location for a search?


回答1:


Thanks @Sascha Galley. I also find another easy way.

Just add &locale=en_US in Facebook Graph search API query URL.

This is languages and locales list refrence




回答2:


I don't know exactly which results are different and which skd version you are using, but one possible approach is to send the accept-language header with the cURL request. In the facebook api php file add the following line in the function makeRequest() below $opts = self::$CURL_OPTS;

$opts[CURLOPT_HTTPHEADER] = array('Accept-Language: en-us,en;');

This post is almost two years old: Get Facebook Graph API results in English

Actually, this issue should have already been solved: Return values from the graph-api depend on geographic server location



来源:https://stackoverflow.com/questions/3595518/facebook-graph-api-search-results-depends-on-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!