Display Twitter Followers as Text – Syberplanet API
Posted by Syberplanet on May 28th, 2009 - 1,191 views

Making the Call
Input Variables
Output - output
Output Types
- Text
- Javascript
Simple Example
This Will Return “88″ which can be accessed through php.
Simple HTML Example
<p>
Join the <b><script type="text/javascript" src="http://api.syberplanet.net/twitter/?u=Syberplanet&output=js"></script></b> people who follow Syberplanet and receive our updates
</p>
Using PHP To embed twitter count
$username = “Syberplanet”; // Your twitter username
$output = “text”; // text or js
$url = “http://api.syberplanet.net/twitter/?u=$username&output=$output“;
$followers = file_get_contents(“$url“);
echo $followers;
?>
The Javascript output can be used anywhere and all the CSS properties applied to the tag its contained is will show on the twitter count. The javascript access does not require any PHP or any other server requirements and can be used on any site or blog.
The PHP code simply gets the contents of the API page (Followers) and embeds it wherever the code is placed. The PHP can be used by just adding < ?php echo $followers; ?> to the site that runs apache.
If you enjoyed this post, make sure you subscribe to our RSS feed!




on June 10th, 2009
Can you give me the php that your using to get the followers count? I need it to be on my clients server.
on June 10th, 2009
Hello Derek,
Sorry, we can’t give out the code that makes this service. You are free to use it and if you think this site might shut down and affect your client, we assure that we will email you before anything like this happens.
Our code is slightly better than this one, but I think this is enough to get you started. http://tinyurl.com/8s69hc
Syberplanet
on June 25th, 2009
Thanks very much. I just implemented it on my blog (WordPress 2.8) and it works flawlessly!