/ Published in: PHP
Display the number of people following you on Twitter using this custom Twitter badge. The code simply returns a number so you can style it however you like.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function curl($url) { return $data; } function GetTwitterFollowerCount($username) { $twitter_followers = curl("http://twitter.com/statuses/user_timeline/".$username.".xml?count=1"); $xml = new SimpleXmlElement($twitter_followers, LIBXML_NOCDATA); return = $xml->status->user->followers_count; } echo GetTwitterFollowerCount("YourTwitterName");
URL: http://www.nealgrosskopf.com/tech/thread.php?pid=57