谁能告诉我怎么用php把feedburner的订阅者算作文本?我正在尝试以下方法,但它不起作用,因为我认为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;发布于 2012-02-28 23:55:03
需要将第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/
https://stackoverflow.com/questions/7069060
复制相似问题