开发者

How to get facebook total likes for a facebook application?

开发者 https://www.devze.com 2023-01-28 02:36 出处:网络
I know you can get the total fan count for a facebook page via the facebook graph api. But I cannot seem to be able to get the total likes (or fan count) of a facebook application. Take for example, g

I know you can get the total fan count for a facebook page via the facebook graph api. But I cannot seem to be able to get the total likes (or fan count) of a facebook application. Take for example, graph.facebook.com/castleage, notice that the fan count is missing...any clues on how to do so? T开发者_StackOverflow中文版hanks.


Try luck with something like this:

$data = array();

try {
    $data = $facebook->api(array(
        'query' => 'SELECT uid FROM page_fan WHERE page_id=' . $fanpageId,
        'method' => 'fql.query'
    ));
} catch(Exception $e) {
    print_r($e);
}

$fanCount = count($data);    

print_r($fanCount);
0

精彩评论

暂无评论...
验证码 换一张
取 消