我正在尝试获取特定网址的类似计数,并且我尝试了多种方法并进行了搜索,但未能找到解决方案……这是我尝试过的:
方法一:
$fburl = 'http%3A%2F%2Fwww.olympusmons.com%2Fradio%2F%3Fid%3D1377';
$json_string = file_get_contents('http://api.facebook.com/restserver.php?method=links.getStats&urls=' . $url);
$json = json_decode($json_string, true);
方法二:
$fql = "SELECT url, normalized_url, share_count, like_count, comment_count, ";
$fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM ";
$fql .= "link_stat WHERE url = '".$url."'";
$apifql="https://api.facebook.com/method/fql.query?format=json&query=".urlencode($fql);
$fb_json=file_get_contents($apifql);
return json_decode($fb_json);
方法三:
$json_string = file_get_contents('http://graph.facebook.com/?ids=' . $url);
$json = json_decode($json_string, true);
现在,如果我转到该网址(http://graph.facebook.com/?ids=http://www.olympusmons.com/radio/?id=1377),这最后一种方法总是返回 4 但真正的值应该是0