Syber Blog - Your Source 4 All Web 2.0

Display Twitter Followers as Text – Syberplanet API

Posted by Syberplanet on May 28th, 2009 - 5,178 views

Syberplanet Twitter API

Making the Call

http://api.syberplanet.net/twitter/?u=Twitter+Username

Input Variables

Username - u
Output - output

Output Types

  • Text
  • Javascript

Simple Example

http://api.syberplanet.net/twitter/?u=Syberplanet&output=text

This Will Return “88″ which can be accessed through php.

Simple HTML Example

<script type="text/javascript" src="http://api.syberplanet.net/twitter/?u=Syberplanet&output=js"></script>
<h2>Visit Us On Twitter</h2>

<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

<?php

$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!


7 Responses to “Display Twitter Followers as Text – Syberplanet API”

  1. Can you give me the php that your using to get the followers count? I need it to be on my clients server.


  2. 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


  3. Thanks very much. I just implemented it on my blog (WordPress 2.8) and it works flawlessly!


  4. Thanks. This script works fine, but it wasn’t the script I was looking for. I was looking for one that allows users to see the follower’s avatar/ profile picture when you embed it.


  5. This information is priceless. How can I find out more?|


  6. Code is perfect, but I’m unable to get the followers, Does this requires twitter authentication..??


  7. You really make it appear so easy with your presentation but I in finding this topic to be actually one thing that I think I’d by no means understand. It sort of feels too complex and very huge for me. I am taking a look ahead on your subsequent put up, I will attempt to get the dangle of it!


Leave a Reply


Advertise on Syber Blog
Earn $$ with WidgetBucks!