2013-02-07 157 views
0

我想獲得我的網站頁面的Facebook的份額計數,鏈接計數和評論計數。我正在嘗試使用FQL。這裏是我的代碼:Facebook的FQL查詢

<?php 
     $query = "select comment_count, share_count, like_count from link_stat 
     where url=<my_url_of_page>"; 
     //My FQL Query 

     $url = "https://graph.facebook.com/fql?q=".$query; 
     $fbData = file_get_contents($url); 
     echo $fbData;  
?> 

當我在圖形資源管理器中運行相同的查詢,它會給出正確的結果。當我從我的機器調用它時,它顯示空白頁面。

請建議我在這裏做錯了什麼。

- 謝謝你的時間。

+0

它不需要訪問令牌嗎? – ogzd

回答

0

您需要login as an app才能使用link stat表。

按照documentation中的步驟作爲應用登錄。