You can show number of your Twitter followers by using this function. If you are a WordPress user, simply copy and paste it into the functions.php file.
<?php
function get_twitter_followers($username) {
$twitter_count = get_option("twitterfollowerscount");
if ($twitter_count['lastcheck'] < ( mktime() - 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name= . "$username"');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$twitter_count['count'] = $match[1];
}
$twitter_count['lastcheck'] = mktime();
update_option("twitterfollowerscount",$twitter_count);
}
return $twitter_count['count'];
}
?>
Call the function like:
<?php echo get_twitter_followers("yourtwitter"); ?>
That’s it. Now you can brag with your popular Twitter account
Hey Thanx for this. I´m going to use it1