Requesting multiple Facebook fanpage data in a single call
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')));
精彩评论