Software & Tech

Display Feedburner Subscriber Count In WordPress Blog

Took me way to long to find this one #heartache #timewasted.

If you want to display your feedburner subscriber count in plain text on WordPress or any other PHP page, do this… just change FatherApprentice to your FeedBurner URI (via Tech3Edge).

// this is all PHP code
//Grab Feedburners
$username = 'FatherApprentice'; /* feedburner feed name */
$api_page = 'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=FatherApprentice';
$xml = file_get_contents ( $api_page );
$profile = new SimpleXmlElement($xml, LIBXML_NOCDATA);
$rsscount = (string) $profile->feed->entry['circulation'];
$data['rss'] = $rsscount;

echo 'RSS subscriber:' . $data['rss'];

I wasted so many goddam hours trying to figure this out via PHP, JQuery, converting XML to RSS and then to JSON… But this one worked on my dev servers and live. This is my public service announcement.

If you know of any other ways to do this that are more simple or that allow for cacheing, plz let me know!

{ 2 comments… read them below or add one }

Josh Einstein May 29, 2011 at 9:51 pm

Unfortunately that API has been deprecated and may eventually be retired as Google has recently announced is the fate of many other API’s.

http://code.google.com/apis/feedburner

Chase May 30, 2011 at 12:23 am

Argh! I’m such a makeshift dev when it comes to this kind of stuff. Any thoughts on a more up to date way of doing this?

Leave a Comment

Previous post:

Next post: