
I believe you’ve seen websites and blogs that uses the text-based Feedburner subscriber count instead of the chicklet. I hope you are not getting the idea the these guys update their feed count manually. Instead, it can be done easily with scripts, and the reason why you want to do is - it gives you total flexibility in terms of design, styling and display.
Step 1
Copy paste the following code in your template, replace feedburner-id with your Feedbuner username. This script will grab you the feed count in numbers.
<?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 ?>
Step 2
Paste this anywhere you want and it’ll display a feedburner subscriber count in text.
<?php echo $fb;?>
To style it nicely with your website or blog’s theme, add <p> or <div> and tweak the CSS accordingly.
via 45n5
Don't miss any post. Subscribe to Hongkiat's RSS feed now.
Related Contents |
Sponsors |
|
Posted by hongkiat in Web Tricks, Wordpress Tips Tricks , at 07.01.08
Tags: feedburner, feedcount, subscriber, text based |
|



















Comments
rei July 1st, 2008
hey..thats easy, thanks..u just gave me an idea how to fake the number..lol
Replyhongkiat July 1st, 2008
@rei Yeah but there’s really no point faking because it’s easy to find out if someone is faking it :-)
ReplyJohnson July 1st, 2008
thank you very much for this beautiful piece of code as i was looking for this from a long time,
just because i needed to use this for my new blog template…
Replyrei July 1st, 2008
no..i was just kidding, i always wonder how to get the feedburner stat..till i read it here, nice post
ReplyDanny July 1st, 2008
Very useful tip man :)
ReplyRamy July 1st, 2008
Thanks.. Dugg. :)
ReplyHtoo Tay Zar July 1st, 2008
Thanks a lot mate!! Now, I can design my feed counter text =) thanks
ReplyA Suresh Kumar July 1st, 2008
Excellent Code, i am searching for integrating this concept in my blog. i will do it now.
ReplyFriendstermod July 1st, 2008
Wow, I think I should use that code. But I still wonder how to do that at my other blog (blogger based)..
ReplyLee July 3rd, 2008
Nice information. :)
ReplyJuan Carlos July 8th, 2008
thanks for the trick
;)
ReplyRúben M. July 30th, 2008
I am using this for about 2 weeks i use a simple style :) but i recommend this code, is awesome to use lol
ReplyMarco August 4th, 2008
If your server doesn’t support CURL, you can also try to load the XML file created by Feedburner.
To do so, please read the following article:
http://www.marcofolio.net/webdesign/show_your_feedcount_the_way_you_want.html
Keep on bloggin,,,
ReplyTony August 5th, 2008
I think there needs to be a note about caching the result. Feedburner stats update just once each day; and it’s really not a good idea to have to wait for an external page to be loaded and parsed, before any of your own pages even begin to render.
ReplyFubiz August 8th, 2008
Thanks for the tips.
ReplyEudes August 12th, 2008
Hey ! something is wrong !
I am getting 1662 feed readers!! :)
I don´t have that much.
Have any one gone through this too??
Am I missing something??
ReplyEudes August 12th, 2008
never mind, never mind…..just read
http://code.google.com/apis/feedburner/awareness_api.html
and you mentioned also “…replace feedburner-id with your feedburner username…”
i need to me more patience and read more carefully :)
ReplyTrackbacks