有人能告诉我我怎么能得到feedburner订阅者计数为文本使用php?我正在尝试以下,但它不起作用,因为我认为feedburner已经改变了xml文件的内容。谢谢你的帮助。
$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=USERNAME";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $whaturl);
$data = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
echo $fb;
需要将第7行修改为:
$fb = $xml->feed->entry->attributes()->circulation;
//以后再编辑
我实际上有几个帖子在我的博客现在与代码获取facebook/twitter/feedburner计数。APC缓存的代码在这里:http://www.glowingminds.co.uk/facebook-likes-twitter-follows-and-feedburner-count-in-php-with-curlsimplexml-deluxe/