作者:hongkiat.com 来源:The sky of Daemon!   酷勤网收集 2008-07-08

摘要
  有什么方法能把Feedburner上的订阅数显示在自已的Blog上呢?其实我看到过很多朋友在想方设法这么干,本文为我们提供了一种更简单实用的方法,那就是通过FB的API获取统计数据,同时以字符方式显示于Blog上。

FeedBurner被封已经有很长一段时间,不过最近听说Google 将把Feedburner合并到Google帐户中,这对于许多Blogger来说,是很期待的一件事情,我同样也希望能尽早合并。

但在合并之前,有什么方法能把Feedburner上的订阅数显示在自已的Blog上呢?其实我看到过很多朋友在想方设法这么干,不过这篇文章为我们提供了一种更简单实用的方法,那就是通过FB的API获取统计数据,同时以字符方式显示于Blog上。

方法如下:

步骤一

复制下面的代码到模版中,记得把FeedBurner ID替换为自已的ID,也就是”uri=fbid “中的 fbid。

<?php
//get cool feedburner count
$whaturl=http://api.feedburner.com/awareness/1.0/GetFeedData?uri=fbid;

//Initialize the Curl session
$ch = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);

$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];

//end get cool feedburner count
?>

步骤二 在你要输出统计数据的地方,在模版中添加如下代码。

<?php echo $fb;?>

另外,刚听说Feedburner官方还推出了一个Feed代理功能,地址是这样的:

http://feedproxy.feedburner.com/theskyofdaemon

如何?可以正常访问Feed吧?那么干脆把该链接也加上吧,我就是这样做的。

Tips:用字符方式显示Feedburner订阅数 - fb

来自:http://blog.bsdos.cn/2008/07/08/feedburner_count.html

上一篇:Feedburner推出Feed代理烧录地址   下一篇:Aiderss:治疗RSS过载的良药