在单个呼叫中请求多个Facebook粉丝数据 [英] Requesting multiple Facebook fanpage data in a single call
问题描述
我有大约20个Facebook粉丝们安装了所有的欢迎/家庭应用程序安装。有没有办法统计所有的喜欢从这些粉丝显示在我的应用程序?我已经尝试使用JavaScript SDK FB.api()给它的数组(使用.toString()和.join(','))以及JSON对象甚至直接输入。看来Facebook一次只能处理一个fanpage id请求的数据。我还没有看,但是有一种方法可以在PHP中执行。
$ b
多页图形网址 - https://graph.facebook.com/?ids=19292868552,11239244970
多页请求作为Facebook JavaScript SDK示例:
FB.api(
'/',
{ids:19292868552,11239244970},
函数(响应){
if(!response || response。错误){
console.log(response.error);
} else {
console.log(response);
}
}
);
多页请求作为Facebook PHP SDK示例:
$ b $ ('/','get',array('ids'=>数组('19292868552','11239244970')) );
I have about 20 Facebook fanpages setup with a "Welcome/Home" app install across all of them. Is there a way to tally up all the "Likes" from these fanpages to display on my app? I've tried using the JavaScript SDK FB.api() feeding it arrays (using .toString() and .join(',')) as well as JSON objects and even direct input. It seems like Facebook can only handle one fanpage id request for data at a time. I haven't looking yet, but is there a way to do this in PHP. I feel I may run into the same situation.
Suggestions would be great!
Graph URL for Multiple Pages - https://graph.facebook.com/?ids=19292868552,11239244970
Multiple Pages Request as a Facebook JavaScript SDK Example:
FB.api(
'/',
{ids : "19292868552,11239244970"},
function(response) {
if (!response || response.error) {
console.log(response.error);
} else {
console.log(response);
}
}
);
Multiple Pages Request as a Facebook PHP SDK Example:
$result = $facebook->api('/', 'get', array('ids' => array('19292868552','11239244970')));
这篇关于在单个呼叫中请求多个Facebook粉丝数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!