Posted By

jeeremie on 10/20/09


Tagged

rss feedburner


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jeeremie
vagrantradio


Add feedburner count to your site - text only


 / Published in: PHP
 

URL: http://yoast.com/feedburner-subscription-feedproxy-google/

Add your feedburner count text only to your site. Check Google code for Feedburner Awareness API: http://code.google.com/apis/feedburner/awareness_api.html

Replace "yourURIhere" with your URI. To find it, go to Feedburner dashboard and click "Edit Feed Details. You will see something like this:

Feed Address: http://feeds.feedburner.com/web-kreation/IaJu (Your FeedBurner feed)

In this example, the URI is "web-kreation/IaJu"

  1. <?php
  2. $url = "https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=yourURIhere";
  3. $ch = curl_init();
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. $data = curl_exec($ch);
  7. curl_close($ch);
  8. if ($data) {
  9. preg_match('/circulation=\"([0-9]+)\"/',$data, $matches);
  10. if ($matches[1] != 0)
  11. $fb['count'] = $matches[1];
  12. $fb['lastcheck'] = mktime();
  13. update_option("feedburnersubscribecount",$fb);
  14. }
  15. echo $fb['count'].' Readers!';
  16. ?>

Report this snippet  

You need to login to post a comment.