A couple of months back I blogged about how to show off your FeedBurner subscribers. In the comments then, a couple of people told me the code didn’t work for them. After a few back and forths I found out those people were on FeedBurner’s new servers, the Google ones.
This new server actually has a new API Endpoint as well, and this endpoint brings along a bit of trouble. Google in all its wisdom decided to move the API onto HTTPS. Problem is, I was using Snoopy, which rocks, but doesn’t work with HTTPS easily. It needs CURL for that, and if it needs CURL anyway, why not use the built-in PHP CURL. So, here’s the code to use when you’re on feedproxy (if this doesn’t work for you, try the above linked older code):
$url = 'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=joostdevalk';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
if ($data) {
preg_match('/circulation=\'([0-9]+)\'/',$data, $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!';
Enjoy!

Funny you should be promoting FeedBurner.
I started using your Sociable plugin after FeedBurner abandoned support for its FeedFlare script. Didn’t bother to tell anybody — just abandoned it.
You sure you want to help these guys?
The original feeburner display counter you posted, 3 times it failed to load the api and diplayed a bunch of errors before the rest of my blog had loaded. Is this because of the new servers and connetion took a bit longer than it should have? I will try your new code, but so far I have had no problems again but I don’t want any more loading problems so if it comes up again I will post again with the reason the code did not load.
I have been having this issue since moving to Feedproxy so I will try to get it working on my blog. Thanks Joost!
You have a extra closing bracket on the second last line…..otherwise…it works great!!!
Thanks!
Thx, fixed that!
Got it working great at http://www.didigetthingsdone.com.
Thanks for the help. I did need to add an extra opening bracket after the second if statement but apart from this, it all works a treat and looks nice again on my blog.
Thanks!
I spoke too soon.
All worked fine, then it just stopped? Now, $fb[‘count’} has a null value. The strange thing is that it worked fine for 15 minutes..
Check out my previous post and steal the caching I used there :)
Thanks,
Just trying that now.
I cut the caching code and all works fine.
Thanks, this looks great again on my blog!
Have a great Christmas!
Sorry, designer here, not a developer. I’m a bit worried that I’ll have Andrew’s same problem, but I have no clue how to paste in the caching from the previous link. Did you already update the above code to include the same caching as the previous solution, or do I need to somehow use the mktime() < 600 line? I’m just totally ignorant of the syntax.
Thanks for your help!
Joost, thanks for this tiny curl script. I will use this to show off the subscription.
My subscribers shows 900 odd. but when i open this https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=ThinkersOnMove link in browser. It shows circulation=”0″ . Any reason why?
Let’s me test the new one ;)
Works great. Can you write about caching the queries?
This same code with the cache implemented is in my blog in case anyone is looking for a easy copy paste of this method code!!
http://www.theanand.com/blog/index.php/just-ripples/display-feedburner-subscriber-count/
this stopped working for me all of the sudden – nothing displays
i reverted back to the old show off code, it works, but shows an incorrect subscriber count
Can’t get to work. Nothing displays, I tried both code.