How To Display Feedburner Subscriber Count In Text With A Script

by Salman Ahsan

in WordPress Tricks & Hacks

email

How To Display Feedburner Subscriber Count In Text

A lot of websites and blogs use text-based Feedburner subscriber count instead of the chicklet. This makes it look for real since you are displaying the real subscribers instead of fake ones unlike some sites. Now when you see 20-30k subscriber counts on various blogs, I hope you don’t think that the authors of the blogs are doing it manually because its simply not possible. All these can be done easily with a script. You definitely want to do this because it gives your blog credibility as well as flexibility in terms of design and display.

STEP 1

Copy paste the following code into your wordpress template and replace feedburner-id with your Feedbuner username.

” //get cool feedburner count
$whaturl=”http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburner-id”;

//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'];
//end get cool feedburner count “

STEP 2

Copy and Paste the following code wherever you want to display the Feedburner subscriber count in text.

” echo $fb; “

Last but not the least, if you want to style the feedburner count with your blog then, add <p> or <div> and tweak the CSS accordingly. 

Check Out Related Posts From The Blog

14 Days Blogging e-Course

The ultimate blogging e-course that will help you take your blog to the next level. Coming Soon!



Leave a comment & let me know what you think!

{ 6 comments… read them below or add one }

earningstep December 27, 2009 at 2:08 am

great tips man. i will try this for sure…

Reply

S Ahsan January 4, 2010 at 6:19 pm

Glad you like my stuffs. When you try these, make sure you try on a new blog so you dont mess up the old one if some things goes wrong. I am planning to provide some video tutorials for all these coding pretty soon. :)

Reply

Tom January 6, 2010 at 10:50 am

Great hacks! I really like the Author box one. Might have to take advantage of that one!

Reply

Melvin January 7, 2010 at 10:27 am

I think there's a specific plugin that does that (w/c I forgot).. Either way just be careful because I've heard many horror stories that goes with it

Reply

S Ahsan January 8, 2010 at 1:13 am

Well as i always say, to try out the hacks you should do it in a new wordpress installation if you are new to this (coding and stuff). In this way you can learn a lot and then implement it on your actual blog once it works out.

Reply

S Ahsan January 8, 2010 at 1:15 am

I appreciate it. Glad you liked it. Theres lot more to come. Stay in the loop :)

Reply

Leave a Comment

Anti-Spam:

{ 1 trackback }