1 Comments
如何显示FeedBurner订阅数
来自45n5的哥们儿给我们介绍了一种用文本显示Feedburner订阅数的方法,其介绍这个方法的主要目的是,用文本显示就意味着你可以完自定义订阅数的样式风格,而不是局限于Feedburner官方提供的订阅数统计图标.而对于国人来说,能不能美化都是其次了,能显示就是好事儿,让我们看一下是如何操作的:
1. 复制粘贴下面的代码到你的模板里面.这段代码是利用Feedburner的API来获取你的Feedburner订阅数.
<?php
//get cool feedburner count
$whaturl=”http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rss4real”;
//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
?>
2. 再复制粘贴下面的代码到你想显示Feedburner订阅数的地方.
<?php echo $fb;?>
3. 没有了.



留言列表
Comments List这个,还是不用了,看了伤心…