function twitter_count(){
$count = get_transient('twitter_count');
if ($count !== false) return $count;
$count = 0;
$dataOrig = file_get_contents('http://twitter.com/users/show/wpforce');
if (is_wp_error($dataOrig)) {
return 'Error!!!';
}else{
$profile = new SimpleXMLElement ( $dataOrig );
$countOrig = $profile->followers_count;
$count = strval ( $countOrig );
}
set_transient('twitter_count', $count, 60*60*24); // 24 hour cache
return $count;
}
To use this function, simple echo it wherever you want it.