Return to Snippet

Revision: 41914
at February 24, 2011 21:16 by kirichev


Initial Code
<?php
$twit = file_get_contents('http://twitter.com/users/show/USERNAME.xml');

$begin = '<followers_count>'; $end = '</followers_count>';
$page = $twit;
$parts = explode($begin,$page);
$page = $parts[1];
$parts = explode($end,$page);
$tcount = $parts[0];

if($tcount == '') { $tcount = '0'; }
echo '<b> '.$tcount.' </b> Followers';
?>

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

Initial Description
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.

Initial Title
Display number of Twitter followers in your Wordpress based website

Initial Tags
wordpress, twitter

Initial Language
PHP