Add feedburner count to your site - text only


/ Published in: PHP
Save to your folder(s)

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"


Copy this code and paste it in your HTML
  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. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.