Amit Bhawani Blog

Stay Updated!

Powered by Genesis

You are here: Home / Blogging / How to Show Google Feedburner Subscribers Count in Text

How to Show Google Feedburner Subscribers Count in Text

July 9, 2010 by Amit Bhawani

Feedburner Readers Chicklet StatsThe Free feed management service from Google under the brand name is used by 95% of the bloggers all around the world and this is because its completely free and offers with nice features. One best feature is that you can display all your readers count on the blogs sidebar under the name of a badge. We had previously written a similar article on How to Show Feed Readers Count in Text Format but that was using a plugin and in this article you will have to create a simple php file and upload it and get it in working.

The option is available under My Feeds > Publicize > FeedCount > Your Chicklet. There is a HTML code available which has to be copied and added on your sidebar or header or any location where you want to display this badge which is updated every 24 hours with the new number of readers. The only option feedburner offers is different styles of Static & Animated but the same size of chicklet is available and you cannot customize it, hence its better to try out a text version of the same where in we would be importing the numbers count and then displaying them in Plain Text format.

Before we get started into the process you need to Enable The Awareness API which is available under the Publicize > Awareness API > Allow external access to my traffic data. Once this is done the API allows you to display the feeds traffic data in anyway you would like to, rather than the default chicket option. Next you need to create a php file using the following code and then upload to the themes folder under the currently active theme. Make a note that you save this file as feedcounter.php and upload in the theme folder correctly. Do change the uri= to your feedburner feed name.

<?php
$feedcount = get_option("feedrsscount");
if ($feedcount['lastcheck'] < (mktime()-3600)) {
//get cool feedburner count
$whaturl=https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=AmitBhawani;
//Initialize the Curl session
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
$feedcount['count'] = number_format($fb);
//end get cool feedburner count
$feedcount['lastcheck'] = mktime();
update_option("feedrsscount",$feedcount);
}
echo $feedcount['count'];
?>

Next you will have to import this file using a import codde and display it at any location of your choice. Lets say you would like to show the feed readers count on the sidebar, just add the following line through your theme files along with any suffix or prefix like : Our Readers –

<?php include(%u201Cfeedcounter.php%u201D); ?>

A very simple and useful way on displaying your number of subscribers to the feed in a text format rather than the same boring chicklet.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

Related

About

My name is Amit Bhawani and here I like to share my internet/tech experience with my online readers. You can follow me on Twitter, Facebook & Instagram at @AmitBhawani I am also the Editor-in-Chief of PhoneRadar & Master Gadgets

About Amit Bhawani

My name is Amit Bhawani and here I like to share my internet/tech experience with my online readers. You can follow me on Twitter, Facebook & Instagram at @AmitBhawani

Comments

  1. techpage says

    July 9, 2010 at 2:30 pm

    good description

Timeline

Check out Just EV Tweets by @amitbhawani

Recommended To Read

  • How to Find your WiFi Signal Strength & Dead spots in your Home – Best Apps
  • The Wuhan Corona Virus Effect in India – How to Stay Safe
  • This Blogger Lost 25Kgs with this Secret Strategy that Includes a Fitness Tracker
  • Making Money on YouTube, MCN, Useful Tools, Tips & Success Stories
  • The #JaguarPerformance Experience that was Mind Blowing