RSS Readers in sidebar and Twitter.


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

To implemented this code is easy, all need to do write down PHP FeedBurner Counter below in our themes files, example in sidebar.php, header.php or footer.php. Let’s get started, Please note you need replace YOUR FEED ADDRESS with your Feeds,


Copy this code and paste it in your HTML
  1. <?php
  2. $url = file_get_contents('https://feedburner.google.com/api/awareness/1.0/Get
  3. FeedData?uri=YOUR FEED ADDRESS');
  4. $begin = 'circulation="'; $end = '"';
  5. $page = $url;
  6. $parts = explode($begin,$page);
  7. $page = $parts[1];
  8. $parts = explode($end,$page);
  9. $fbcount = $parts[0];
  10. if($fbcount == '') { $fbcount = '0'; }
  11. echo '<b> '.$fbcount.' </b> Subscribers';
  12. ?>
  13.  
  14. <?php
  15. $twit = file_get_contents('http://twitter.com/users/show/USERNAME.xml');
  16. $begin = '<followers_count>'; $end = '</followers_count>';
  17. $page = $twit;
  18. $parts = explode($begin,$page);
  19. $page = $parts[1];
  20. $parts = explode($end,$page);
  21. $tcount = $parts[0];
  22. if($tcount == '') { $tcount = '0'; }
  23. echo '<b> '.$tcount.' </b> Followers';
  24. ?>

Report this snippet


Comments


You need to login to view comments.