而是查询 facebook 的数据,我想解析一个网页,但问题是 facebook 数据是通过 ajax 调用在客户端加载的,所以我想我无法在网页上的第一个查询中获取。有没有办法在没有查询 fb 的情况下在页面上获得 facebook 点赞或分享?
我想以某种方式用 PHP 解析网页,我只是在这里查看,但这不是我想要的:link
编辑
我尝试的是:
<?php
$source_url = "https://www.facebook.com/pages/%D0%9F%D1%83%D0%BB%D1%81%D0%B0%D1%80/177521286028";
$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 = 'http://pulsar.com.mk'";
$apifql="https://api.facebook.com/method/fql.query?format=json&query=".urlencode($fql);
$json = file_get_contents($apifql);
?>
最佳答案
您可以尝试使用 simpleXML http://www.php.net/manual/en/simplexml.examples-basic.php
关于php - Facebook 点赞或分享来自其他页面的计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14622284/