Advertisements

How To Display Number of Twitter Followers as Text

Posted by Lasantha Bandara on May 28th, 2010 File Under : twitter5 Comments

This quick tutorial will explain how to show your number of twitter followers in text.If there are many services as Twitter Remote,to show your number of Twitter followers,their badges will add a ugly appearance to your site.So I think this will help you to show how many twitter followers have for your twitter account without using third-party services.This is very easy to do and only spend few seconds.Now follow the steps given below for this.

1.Log in to your dashboard--> layout- ->Page Elements

2.Click on 'Add a Gadget'.

3.Select 'HTML/Javascript' and add the code given below and click save.

Select HTML/JavaScript

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
   url: 'http://api.twitter.com/1/users/show.json',
   data: {screen_name: 'YOUR-TWITTER-USERNAME'},
   dataType: 'jsonp',
   success: function(data) {
       $('#followers').html(data.followers_count);
   }
});
});
</script>

I have <span id="followers">&nbsp;</span>  Twitter followers.

NOTE : Replace YOUR-TWITTER-USERNAME with your real twitter username.

You are done.

File Under : twitter

5 Responses to “How To Display Number of Twitter Followers as Text”

  1. Robin says:

    Thank You!

  2. Jay-L says:

    thanks

  3. Eduardo Sanguino says:

    Gracias por el aporte, ya he realizado un post con este truco sitando como fuente original tu blog.

    Saludos!

  4. mAn ─ÉiezEl says:

    thanks a lot!

  5. Saimoom (Shine Mat) says:

    lovely tutorial. simple and sharp one. like it. do you know about visitor counter like this?

    http://www.shinemat.com/
    http://www.saimoom.com/

Leave a Reply