gpt4 book ai didi

php - 如何从一篇文章中获取 Facebook 点赞、分享、评论数

转载 作者:可可西里 更新时间:2023-10-31 22:06:19 25 4
gpt4 key购买 nike

我需要从一篇文章中获取 facebook 的点赞数、分享数、评论数

有什么方法可以获取 facebook(点赞、分享、评论)计数

提前致谢。

最佳答案

实际上,您可以使用 FQL 获得更详细的报告。尝试以下查询:

  • SELECT url, normalized_url, share_count, like_count, comment_count, total_count, commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url = 'www.apple.com'

这里是 php 代码:

$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 = 'www.apple.com'";

$apifql="https://api.facebook.com/method/fql.query?format=json&query=".urlencode($fql);
$json=file_get_contents($apifql);
print_r( json_decode($json));

这是预期的结果:

Array
(
[0] => stdClass Object
(
[url] => www.apple.com
[normalized_url] => http://www.apple.com/
[share_count] => 355693
[like_count] => 500374
[comment_count] => 290890
[total_count] => 1146957
[commentsbox_count] => 2
[comments_fbid] => 388265801869
[click_count] => 16558
)

)

关于php - 如何从一篇文章中获取 Facebook 点赞、分享、评论数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6137414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com