Display Feedburner Subscriber Count In Text

August 4, 2008 by: Arshad

When you surf through web sites you may see a feedburner logo which shows the count number of subscribers.But it is really hard to update these count everyday but instead of this you can make with a script.

Copy paste the following code in your template, replace feedburner-id with your Feedbuner username. This script will grab you the feed count in numbers.

Step 1

Copy paste the following code in your template, replace feedburner-id with your Feedbuner username. This script will grab you the feed count in numbers.

<?php
  //get cool feedburner count
  $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rss4real";

//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

Paste this anywhere you want and it’ll display a feedburner subscriber count in text.

<?php echo $fb;?>

Related posts:

  1. Latest Wordpress Plugins(6/8/2009)
  2. ”Read More” Plugin For Bloggers and Post Summary With Thumbnails
  3. Google Chrome Theme-True Live V3.3
  4. Display Firefox History With History Tree Add-On
  5. Add a ”Save as PDF” button to your Blogger Blog

Filed under: TIPS & TRICKS
Tags:

Trackbacks

Leave a Reply