Posted By

kirichev on 02/24/11


Tagged

wordpress twitter


Versions (?)

Display number of Twitter followers in your Wordpress based website


 / Published in: PHP
 

URL: http://www.webm.ag/2010/02/05/how-to-display-your-feedburner-count-and-twitter-followers-without-chicklets/

Put this code in your theme, where you want to show followers count. Don't forget to change USERNAME.xml to your twitter user name.

  1. <?php
  2. $twit = file_get_contents('http://twitter.com/users/show/USERNAME.xml');
  3.  
  4. $begin = '<followers_count>'; $end = '</followers_count>';
  5. $page = $twit;
  6. $parts = explode($begin,$page);
  7. $page = $parts[1];
  8. $parts = explode($end,$page);
  9. $tcount = $parts[0];
  10.  
  11. if($tcount == '') { $tcount = '0'; }
  12. echo '<b> '.$tcount.' </b> Followers';
  13. ?>

Report this snippet  

You need to login to post a comment.