Home » Home Server » Get FeedBurner subscribers count using PHP

Get FeedBurner subscribers count using PHP

UPDATE (01/12/2013): This will no longer work because Google has shutdown FeedBurner API.


FeedBurner is a web feed management provider from Google. It provides custom RSS feeds and management tools to bloggers, podcasters, and other web-based content publishers. Recently, I wrote posts on how to get Facebook like count using PHP and Twitter followers count. Continuing along the same lines, in this post, I will explain how to get FeedBurner subscribers count using a simple PHP script. The number can be stored in cache or a database and displayed as simple formatted text or combined with other numbers to display a total followers/subscribers count thereby saving some much need sidebar-space. It also slightly improves page load speeds. So without further delay, here it goes.
Get FeedBurner Subscribers Count
Feedburner Chicklet

PHP code to get FeedBurner Subscribers Count

The PHP script to get FeedBurner Subscribers count is pretty simple and straightforward:

$fburl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=http://feeds.feedburner.com/htpcBeginner";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $fburl);
$stored = curl_exec($ch);
curl_close($ch);
$grid = new SimpleXMLElement($stored);
$rsscount = $grid->feed->entry['circulation'];

$fburl is the variable to hold the link to access your FeedBurner API. Only edit you have to do is replace htpcBeginner with your account name. You can get it from your FeedBurner page:

FeedBurner MyFeeds
FeedBurner MyFeeds

After you get FeedBurner subscribers count, you can display it as simple text using the following PHP code:

echo $rsscount.' subscribers';

This will output 26 subscribers.

You can even get counts of your Facebook likes and Twitter followers and add them all together and display a combined followers count like this:

Combined Followers Subscribers Count
Combined Followers Subscribers Count

FeedBurner Subscribers Count History

Although you may be able to get FeedBurner subscribers count history and more by other means, I like to record the data in a format I like. I currently get Facebook like count, Twitter followers count, FeedBurner subscribers count, and Alexa site rank and record them in a MySQL database daily to see the growth of my blog. If you make any changes / improvements to your blog then you have the data to see what impact it had on your subscribers / followers count. In a separate post, I will explain how to accomplish this.

Meanwhile, get FeedBurner subscribers count using the above script, get creative, and find innovative ways to use the count. Please do not forget to share your idea with us in the comments sections.

We Are Hiring: Familiar with Media Streaming, HTPC, Home Server, Smart Home, and Home Automation topics? Write about it and earn money. No writing experience needed. APPLY HERE.

Get 20% OFF with IPVanish VPN:

♦   Hide your browsing and streaming activity: No logs and no tracking
♦   Access geo-restricted content from anywhere
♦   Encrypt and anonymize: Kodi, Plex, Downloads, Personal Info
♦   Windows, Mac, Linux, Android, iOS, Router, and more.
♦   Money back guarantee - Sign Up Now

About the author

Anand

Anand is a self-learned computer enthusiast, a part-time blogger, and a Food Scientist by career. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs on htpcbeginner.com and smarthomebeginner.com.

Archives

Join the other 110,000 followers