Post Pic

How to: Display your feedburner count in full text

Are you using feedburner? Probably yes, just as a lot of bloggers do. If you don’t like the chicklet dedicated to display your feedburner count, just read this recipe which is a new method to get your feedburner count in text mode.

To display your feedburner count in full text on your WordPress blog, simply paste the following on any of your theme file, for exemple sidebar.php:

<?php
$fburl=”https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=YourURL“;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $fburl);
$stored = curl_exec($ch);
curl_close($ch);
$grid = new SimpleXMLElement($stored);
$rsscount = $grid->feed->entry['circulation'];
echo $rsscount;
?>

22 Responses

Feb 06 2009 08:35

No caching? No protection from stupid-feedburner-displaying-zero? :)

Feb 06 2009 08:53

@Rarst: If you have a recipe for that, just tell me and I’ll publish it ;)

Feb 06 2009 09:13

@Jean-Baptiste Jung

Joost de Valk has published such snippet (with caching and fix for zeroes) for old Feedburner api
http://yoast.com/feedburner-subscriber-count/

I don’t think it works with Google, had not tried yet (still on old server). Method is also quite different from your snippet.

Feb 06 2009 10:46

Woo good for some theme integration huh!

Feb 06 2009 19:21

Very nice, would like to try think little recipe out..

@Rarst would be cool if we could get a cached version on Google API server..

Feb 07 2009 19:14

Nice one. I’ve known about this for a while. Now, this might’ve just been me (this was about a month ago) but if I used this code offline on my local server, it wouldn’t work. Just a heads up for all. (It worked online, though).

Feb 11 2009 02:09

For Wordpress 2.7 :

Trackbacks :
li.pingback, li.trackback {
background-color:#C2A4B5;
}

VIP :
li.comment-author-VIP {
background-color:#008ADA;
}

USER :
li.byuser {
background-color:#008ADA;
}

Author :
li.bypostauthor {
background-color:#DA0000;
}

=)

Mar 03 2009 15:53

here you forgot to tell that, to activate awareness api in our feedburner account, then only it will ping.. here is the reference url .http://code.google.com/apis/feedburner/awareness_api.html

Mar 13 2009 18:06

working like a charm !! Thanks :)

May 10 2009 15:41

It works, thanks.

Jan 26 2010 15:29

I may have to try that on my blog. Thanks!

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required