How to change FeedBurner Reader Statistic Using PHP cURL


If you want to change the traditional feedburner  reader statistic image use the below program in your widgets which will fetch the readers feedburner .Everyone has one: Digg, Feedburner, Pownce, Flickr, Google Maps, etc. FeedBurner provides a sweet “Awareness API” that allows you to pull statistics from your FeedBurner account. Here’s how you do it using PHP cURL.

//open connection  

$ch = curl_init();  

//set the url, number of POST vars, POST data  

curl_setopt($ch,CURLOPT_URL,‘http://api.feedburner.com/awareness/1.0/GetFeedData?id=#######’);  

curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);    

curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  

     //execute post  

     $content = curl_exec($ch);  

     $subscribers = get_match(‘/circulation=”(.*)”/isU’,$content);  

echo ‘Subscribers:  ’.$subscribers;  

      //close connection  

curl_close($ch);  

/* helper: does the regex */  

function get_match($regex,$content)  

{  

          preg_match($regex,$content,$matches);  

    return $matches[1];  

}  

 

It’s that easy. What makes this even better is that I hate FeedBurner’s “badge” and I can manipulate the result of the above code any way I want.  To learn more about FeedBurner’s Awareness API and the information you can pull about your feed view the below url http://code.google.com/apis/feedburner/awareness_api.html

  Get updates in mail :

1 Comment

  1. vanessa hudgens nude wrote
    at 5:23 pm - 5th September 2008 Permalink

    Hey! Great stuff. +1 tnks :) Visit my blog too.

Post a Comment

Your email is never published nor shared. Required fields are marked *