如何获得只有Facebook页面的数量?

时间:2017-05-10 06:46:31

标签: facebook laravel-5 facebook-likebox

我正在使用此代码:

<div class="fb-like" data-href="https://web.facebook.com/mykliktransport/" data-layout="box_count" data-action="like" data-size="large" data-show-faces="false" data-share="false"></div>

显示如下:

但是想要的只是在这里显示它的计数:enter image description here

1 个答案:

答案 0 :(得分:0)

它现在正在工作......这可能有所帮助 从https://developers.facebook.com/docs/graph-api

获取您的令牌号码
<?
 $fb_page = '1907481709532899'; 
 $access_token = 'Token Number';
 $url = "https://graph.facebook.com/v2.2/".$fb_page.'?access_token='.$access_token;
 $curl = curl_init($url);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);   
 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
 $result = curl_exec($curl);  
 curl_close($curl);
 $details = json_decode($result,true);
 echo $details['likes'];
?>