Well, I section of my latest website had to display the amount of twitter followers that I had. After searching around and finding stupidly long and unclean functions, I decided to create my own..
Might come in useful for someone :) you can also modify it for other things such as displaying your latest tweet.PHP Code:<?php
function getTwitterFollowers($userid) {
$url = "http://twitter.com/users/show.xml?screen_name=$userid";
$xml = simplexml_load_file($url) or die ("Error fetching twitter XML");
echo $xml->followers_count . " followers.";
}
?>
Usage
:)PHP Code:getTwitterFollowers("USERNAME");



Reply With Quote![[PHP] Displaying the amount of twitter followers you have](http://ragezone.com/hyper728.png)


