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.

Related posts

  1. FeedBurner subscription show-off revisited
  2. Using the Technorati API on your blog
  3. Easily display your last Tweet
  4. Install WordPress 2.6.3
  5. Showing subcategories on WordPress category pages

Want more WordPress tips?

You should subscribe to my WordPress Newsletter, as you'll get a whole lot more WordPress tips and tricks there! Also, subscribe to this blog right now with RSS, or daily or weekly emails!

51 Responses to “Showing off your FeedBurner subscribers”

Trackbacks/Pingbacks

  1. A quick and easy way to show your feedburner count
  2. Cosa hanno in comune… | Come guadagnare con un blog
  3. Using the Technorati on your blog - Yoast - Tweaking Websites
  4. A Ghoulish Collection of Links | This Month In SEO - 9/08 | TheVanBlog | Van SEO Design
  5. BlogBuzz October 31, 2008 | Webmaster-Source
  6. A Ghoulish Collection of Links | This Month In SEO - 10/08 | TheVanBlog | Van SEO Design
  7. Showing off your FeedBurner subscribers | The Affiliate Desk
  8. The Technorati API And Your Blog | The Affiliate Desk
  9. Do You Display Your Tweets? | The Affiliate Desk
  10. Code: Displaying Your WordPress Feedburner Count
  11. WordPress 2.6.3: A Security Update | The Affiliate Desk
  12. Code: Displaying Your WordPress Feedburner Count | How To WordPress
  13. Displaying Your WordPress Feedburner Count : Wordpress Money Blog
Hosting by:
Hosted by MediaTemple Grid Services