This tutorial will show you how to display your Feedburner feed count as a plain text. A good example is shown by Smashing Magazine’s feed count.

The Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?php //get cool feedburner count $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=your-feed"; //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 ?> |
You need to replace “your-feed” (3rd row) with your feed url
Now to display your feed count anywhere just echo the $fb variable like this :
1 | <?php echo $fb;?> |
Source : 45n5.com














Display your RSS feed count in plain text | CrazyLeaf Design Blog says:
[...] Read this tutorial and get the PHP code @ CLD Tutorials Posted in : Programming Post statistics : 1 views [...]
Jul 08, 2008, 12:38 pmKevin says:
Nice example of using CURL with PHP. I was struggling to display rss data of the object return by curl. This example helped me to make it working… Nice work.
Jul 08, 2008, 2:44 amPrabhath says:
Great work mate…really helped me your tutorial.
Jul 08, 2008, 7:38 pmThanks