This php code will retrieve the number of twitter followers you have and show it on your page, very simples.
Place this code whereever you want to show the number:
JUST REPLACE
YOUR_TWITTER_NAME with your twitter name.
<?php
function get_data($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PORT, 80);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_REFERER, $referer);
//curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$document = curl_exec($ch);
curl_close($ch);
return $document;
}
$urlpage_data = get_data("http://www.twitter.com/YOUR_TWITTER_NAME");
preg_match_all('#<span id="follower_count" class="stats_count numeric">(.*?)</span>#is', $urlpage_data, $urlmatches);
echo "You have ". $urlmatches[1][0] ." Twitter Followers";
?>