如何显示 FeedBurner 订阅数
很多人都不喜欢 FeedBurner 订阅数的统计图标,如果抓取到 FeedBurner 的订阅数字,再辅以自己设计的图片,利用 css 就可以打造出属于自己的更富个性的统计图标。
首先,需要到 FeedBurner 激活 Awareness API 服务;

其次,在 functions.php 中添加如下函数:
function getRssCount($rss_link) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=’ . $rss_link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$result = curl_exec($ch);
curl_close($ch);
$result = new SimpleXMLElement($result);
echo $result->feed->entry['circulation'];
}
最后,在合适的地方调用:
<?php getRssCount(‘http://feeds2.feedburner.com/centeur’); ?>
Awareness API 的相关文档可以在这里查看。
This entry was posted on Wednesday, June 3rd, 2009 at 8:09 am and is filed under wordpress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



Centeur June 7th, 2009 at 4:25 pm | reply
@西岸:feedsky 没有提供公共的 API,但已经有人嗅探出了地址,http://www.feedsky.com/rpc/feed_statistic_xml.php?u=user