Showing off your FeedBurner subscribers

smashing-subscribers.pngQuite 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.

42 Responses to “Showing off your FeedBurner subscribers”

  1. How many feedburner subs should one have before you start showing the number to the world. 50? 100? 1000?

  2. slick advice , this is definatly a tool to use while designing a header.

    Thanks man !

  3. 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 :-(

  4. nice advice! i've recently asked myself how you could grab the feed circulation. now i know it thanks ;)

  5. 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.

  6. Damn Joost your on fire with all these awesome tips :)

  7. 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.

  8. @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.

  9. @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.

  10. "feedburnerid" is joostdevalk in your code

  11. hey Joost... Does this work for the ones that jumped to the Google version of Feedburner?

  12. sorry but i cant run the code :( , it says "cant find the snoopy class"

  13. Thank you for quick reply :)
    it solves the error ... but no number show up :(
    is it working with feedproxy.google.com uri or not?

  14. I tried your method of using id= but still the code does not work with Feedproxy as of now. Thanks for trying still.

  15. 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!

  16. 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 !

  17. 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.

  18. i added it to my blog and i think it works a treat!!

  19. 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

  20. I've tried them all; hopefully this piece of code will work. I'll let you know anyway; thanks for sharing.

  21. 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?

  22. There is a problem with feedburner today also. The subscribers count is showing 0 :(

  23. Yup, it's not been working today, although it might be due to me have no subscribers??

  24. hmm.. how bout joomla. have your tried it :) pliz

  25. 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.

  26. 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?"

  27. 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.

  28. Very helpful. Plugins are real headaches for such minor tasks. More plugin=More page loading time.

  29. 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

  30. 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

  31. Thanx dude, I was also thinking abt it and got solution for adding the number of subscribers. Let me try it with my site. Great help. Thanx again.

  32. Very useful I'm going to try it...

    Thanks a lot.

    Roberto

  33. Where can I find the "feedburnerid" for each of my feedburner blogs?
    Thanks,
    Gene

  34. nice. will definitely give it a try.

2 Tweetbacks to “Showing off your FeedBurner subscribers”

  1. Cách hiện số lượng người theo dõi qua FeedBurner trên web: http://tinyurl.com/6nlefu

Comments closed, if you feel you have something to say:
drop me a line.

15 Trackbacks to “Showing off your FeedBurner subscribers”

  1. A quick and easy way to show your feedburner count - Mon, October 27th, 2008 at 17:39
  2. Cosa hanno in comune… | Come guadagnare con un blog - Tue, October 28th, 2008 at 00:12
  3. BlogBuzz October 31, 2008 | Webmaster-Source - Sat, November 1st, 2008 at 03:06
  4. The Technorati API And Your Blog | The Affiliate Desk - Tue, November 11th, 2008 at 11:06
  5. Do You Display Your Tweets? | The Affiliate Desk - Fri, November 14th, 2008 at 05:28
  6. Code: Displaying Your WordPress Feedburner Count - Fri, November 14th, 2008 at 09:01
  7. WordPress 2.6.3: A Security Update | The Affiliate Desk - Sat, November 15th, 2008 at 16:29
  8. Feedburner Subscriber Count. « Danniel Blog - Mon, March 30th, 2009 at 08:30