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!

If you’re not on the list   I can’t help you.   Help me help you!

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 Reply

Other posts you’ll like: