0
我在我的网站上使用fb注释,我需要将注释的数量放入一个php变量中,以便我可以操纵它。我该怎么做?提前致谢。如何将评论数量与Facebook评论一起放入php变量中?
我在我的网站上使用fb注释,我需要将注释的数量放入一个php变量中,以便我可以操纵它。我该怎么做?提前致谢。如何将评论数量与Facebook评论一起放入php变量中?
获取commentsbox_count
从link_stat
FQL表,example:
select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'
PHP例子:
$query = urlencode("select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'");
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
if(!empty($response['data'][0]['commentsbox_count'])) {
echo $response['data'][0]['commentsbox_count'] . " comments were found!";
}
完美。谢谢 – 2012-04-01 06:18:39