我目前得到的數通過下面的PHP腳本喜歡的URL的:通過PHP獲得一個URL的喜歡的數量不包括註釋部分接收喜歡的數量
<?php
$source_url = "[my-url-here]"; //This could be anything URL source including stripslashes($_POST['url'])
$url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".urlencode($source_url);
$xml = file_get_contents($url);
$xml = simplexml_load_string($xml);
$shares = $xml->link_stat->share_count;
$likes = $xml->link_stat->like_count;
$comments = $xml->link_stat->comment_count;
$total = $xml->link_stat->total_count;
$max = max($shares,$likes,$comments);
echo "$source_url
<br><br>shares: $shares
<br><br>likes: $likes
<br><br>comments: $comments
<br><br>total: $total
<br><br>max: $max
<br>------------<br>
";
?>
的問題是,通過likes: $likes
,我不只收到的喜歡的URL的數量,但我也得到了喜歡在評論部分(fb腳本)收到的數量。
我目前管理web大賽的基礎上,數目喜歡獲得了個人資料網址,以及一些用戶使用此方案(通過給很多喜歡通過他們的個人資料收到的意見),以增加他們的贏的機會。
所以,我怎麼能得到的實際數目喜歡的URL,在不包括喜歡在註釋框部分職位收到?
謝謝, 亞歷克斯
開放圖表顯示完全一樣的結果我的代碼以上。 FQL在讓facebook通過我的應用程序訪問我的詳細信息後返回到同一頁面。你能發佈一個完整的代碼示例嗎? –
閱讀Facebook SDK的[實現指南](https://developers.facebook.com/docs/php/gettingstarted),並在[Facebook Graph API Explorer]上嘗試查詢(https://developers.facebook.com/tools /資源管理器/)。尼斯回答順便說一句:P –