leungeric.com

Digg del.icio.us Technorati StumbleUpon Twitter

Feedburner Count As Plain Text

Code Snippets | PHP | Tutorials & Resources | WordPress

1 Star2 Stars3 Stars4 Stars5 Stars (5 out of 5)
Loading ... Loading ...

Make a call to the Feedburner API requesting the feedcount for a given burned feed.

Place the following code in your template before where you want to display the count. This will get your feedcount from feedburner. Replace leungeric with the name of your feedburner feed.

<?php
$url="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=leungeric";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
?>

Now we’ve got your feedcount in a variable called $fb. Wherever you want to output your feedcount simply drop in the following code:

<?php echo $fb;?>
  • Digg
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Reddit
  • TwitThis
  • Sphinn
  • BlinkList
  • Furl
  • Mixx
  • NewsVine
  • Slashdot
  • Ma.gnolia
  • Facebook
  • Google
  • E-mail this story to a friend!

No Comments, Comment or Ping

Reply to “Feedburner Count As Plain Text”

Sponsors