Showing off your FeedBurner subscribers
Quite a few websites have started to show of their FeedBurner subscriber count with something else than a widget. To do that, you have to be able to grab the number of subscribers through the FeedBurner API.
Now I bet you want to know how! It's bloody easy in WordPress, just do this:
$fb = get_option("feedburnersubscribecount"); if ($fb['lastcheck'] < ( mktime() - 600 ) ) { $snoopy = new Snoopy; $result = $snoopy->fetch("http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburnerid"); if ($result) { preg_match('/circulation=\"([0-9]+)\"/',$snoopy->results, $matches); if ($matches[1] != 0) $fb['count'] = $matches[1]; $fb['lastcheck'] = mktime(); update_option("feedburnersubscribecount",$fb); } } echo ''.$fb['count'].' Subscribers can\'t be wrong! Subscribe by <a href="http://yoast.com/email-blog-updates/">email</a> or to the <a rel="nofollow" href="http://feeds.feedburner.com/joostdevalk">RSS feed</a> now!';
Copy, paste, replace feedburnerid with your own FeedBurner ID, and you're done!
Update: updated the code to include caching, as you might overload the FeedBurner API otherwise.
Update 2: if you get an error saying it can't find the class Snoopy, add this above the code:
require_once(ABSPATH . 'wp-includes/class-snoopy.php');
If this doesn't work for you, and you're on FeedBurners new feedproxy.google.com servers, try this solution.
Related posts
- FeedBurner subscription show-off revisited
- Using the Technorati API on your blog
- Easily display your last Tweet
- Install WordPress 2.6.3
- Showing subcategories on WordPress category pages







How many feedburner subs should one have before you start showing the number to the world. 50? 100? 1000?
slick advice , this is definatly a tool to use while designing a header.
Thanks man !
Nifty little piece of advice. One does however need a few more subscribers than I have before you to show off the number of subscribers :-(
nice advice! i've recently asked myself how you could grab the feed circulation. now i know it thanks ;)
My WP theme uses the feedcount plugin to display the Feedburner readers. Check it out at http://www.didigetthingsdone.com.
I think it looks much better than the standard Feedburner widgets.
Damn Joost your on fire with all these awesome tips :)
Just updated the code to include caching, as you might otherwise overload the FeedBurner API :)
I am using FeedCount plugin as well. My only problem is FeedBurner reporting zeroes often, I wish it displayed last valid value instead of that.
@Rarst: I'll have a look at feedcount, I bet you can code that in.
@Joost de Valk
Thanks! You might code this into your snippet it gets bigger with each page reload it seems. :) Quite a few people I know are having problems with zeroes from FeedBurner. :( I thought it was fixed some time ago but now it started again.
@Rarst: done, coding it into the snippet was easy, just had to add the line "if ($matches[1] != 0)".
@Joost de Valk
Thanks again! I've implemented your snippet at my blog. After embarassing moment of forgetting to change feed id and suddenly displaying 4k subscribers for few seconds. :) I've also increased update interval, FeedBurner updates once per day, no sense in bugging it often.
"feedburnerid" is joostdevalk in your code
@Hebdo: thx, fixed that, that's what you get for copy / pasting your own code ;)
hey Joost... Does this work for the ones that jumped to the Google version of Feedburner?
Not yet, I'll have a look at that though, stay tuned for updates!
sorry but i cant run the code :( , it says "cant find the snoopy class"
@sunipeyk: updated the post, add that require I added in the update.
Thank you for quick reply :)
it solves the error ... but no number show up :(
is it working with feedproxy.google.com uri or not?
Not yet, let me look at that now!
If anyone who use feedproxy would please try to replace the uri=feedburnerid with id= and then the number you can see in the URL of the backend of feedburner when editing your feed. If this works, please comment with an example edit link in feedburner so I can add how that works to the post!
I tried your method of using id= but still the code does not work with Feedproxy as of now. Thanks for trying still.
Loving the guy on the toilet. Wish I could read my feeds on the toilet. Maybe get a kindle.
I'll probably get something like this online when I have some numbers to show. Still working on it!
Thanks for your nice tip. Btw, could you tell me how could i do this on the New Google Feedburner ?? Bcos i have transfered all of my feeds to the New Google Feedburner at http://feedburner.google.com
Waiting for your guide !
Thanks for looking into the google feedburner thingy. I gave it a shot here:
http://api.feedburner.com/awareness/1.0/GetFeedData?uri=fbf1vnvih05nk5modg4vepgnb4
but it does not still work. There is no official help on this either.
i added it to my blog and i think it works a treat!!
Hi, thanks for the tutorial, but I wonder where shall I put the code to? shall i put it at where i want to display the feed count? i tried to put the code inside Dreamweaver before uploading to my site but Dreamweaver recognizes it as texts instead of codes... sorry i have no experience to coding... please help me out. Thanks a lot! :D
I've tried them all; hopefully this piece of code will work. I'll let you know anyway; thanks for sharing.
Nice tip, but there seems to be a problem with the display of subscribers count.
Check out my site http://www.techpp.com. I am not able to see the subscriber count at all. can't think what have I missed?
There is a problem with feedburner today also. The subscribers count is showing 0 :(
Yup, it's not been working today, although it might be due to me have no subscribers??
hmm.. how bout joomla. have your tried it :) pliz
Nice code. Thanks for sharing......
Have a try to add my feedburner into my blog Thinkpad T60. The reason that code cant work must be the feedburner showing problem. You can see all the posts while click the RSS links.
I am still waiting for some help. requoting again -
'Nice tip, but there seems to be a problem with the display of subscribers count.
Check out my site http://www.techpp.com. I am not able to see the subscriber count at all. can't think what have I missed?"
Thanks a lot for the info.
I have compiled some of the methods, including yours, to do this here,
http://www.agentwordpress.com/five-ways-to-show-your-total-feedburner-subscriber-count
Check it out and please provide me your valuable feedback.
Very helpful. Plugins are real headaches for such minor tasks. More plugin=More page loading time.
I've tried them all, and for the moment I've NOT been able to show something else that the official widget. If your piece of code works, you'll be my new god!
Cheers,
Syl
Very helpful Plugin but it doesn't work on my website :-(
http://www.makemoneykingdom.com . Anyone with good knowledge might probably be able to help me out. I wanna put this on my website so badly. Pls help, I request
Thanks