1

我一直在試圖找出爲什麼這個請求,Facebook的API返回0喜歡這個頁面 - https://www.facebook.com/Lilyspad58爲什麼Facebook圖形返回0喜歡這個頁面?

這裏是請求:

https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22https://www.facebook.com/Lilyspad58%22

響應:

<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> 
    <link_stat> 
     <like_count>0</like_count> 
    </link_stat> 
</fql_query_response> 

在此處,API返回喜歡的數量的示例:

https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22https://www.facebook.com/CriaBabyShoes%22

唯一區別是url參數中的頁面。

這是我一直在使用PHP代碼:

function fbLikeCount($url) 
{ 
    //Construct a Facebook URL 
    $req = "https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22$url%22"; 
    $contents = file_get_contents($req); 

    print "REQ: $req\n"; 
    print "Response: $contents\n"; 
    if ($xml=simplexml_load_string($contents)) 
    { 
     $likes = $xml->link_stat->like_count; 
     return($likes); 
    } 
    return 0; 
} 

我已經嘗試了一系列的URL參數其它Facebook頁面,並從我已經能夠確定它,它要麼工程或返回0。當它返回0,它總是返回0。當我手動檢查在瀏覽器中我看到了喜歡的頁面。

有,我可以在FB文檔找不到明顯的解釋,SO或谷歌。

回答

相關問題