Advertisements

Get your Feedburner follower count in PHP

Important: Please see the update at the bottom of this post.

If you use Feedburner for RSS circulation, here’s a handy ready-to-go way of getting your Feedburner follower counts using PHP. This requires that you have the Feedburner Awareness API enabled for your feed.

Note that the code below uses PHP’s file_get_contents() rather than the preferred cURL function, but it does work. You may also want to cache your result to prevent hitting any API limitations.

function GetFeedburnerFollowerCount($feed){
$feedburner_xml = file_get_contents("http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=".$feed);
$xml = new SimpleXmlElement($feedburner_xml, LIBXML_NOCDATA);
$new_feedburner_followers= $xml->feed->entry['circulation'];
return $new_feedburner_followers;
}

You can also substitute ‘hits’ or ‘reach’ for ‘circulation’ in the example code.

Update: The Google Feedburner API is no longer available.

Comments are welcome, as always.

Advertisements