Social following counter is now popular among industry because companies and blogs with high social following likes to display their followers count in their blogs. Since,Tuesday, May 7, 2013 Twitter closed its API v1, since then it is not possible to get Twitter followers count and many other data through any client-side method. So, in this post I'll tell that how to get followers count using Twitter Counter, it is a third party application which have its own API.So lets begin with it.
As always, the first rule to access any API is to first signup and then to get an API key. So first go to Twitter Counter and sign up with any Twitter account. Actually, it is one of the best source to get in detail stats of your Twitter account, hence you can analyse your Twitter activity more conveniently. So lets back on our topic.
- First go to Twitter Counter and sign up with any Twitter account.
- Then go to API Documentation page. Here you will find every related document about their API. If you will notice, then you will require API key to access their data, so just click on green button on right top side, Request an API key.
- Fill up the form with correct information, after submission you will receive your API key on your e-mail.
Request your data
URL: http://api.twittercounter.com/?apikey=e9335031a759f251ee9b4e2e6634e1c5&twitter_id=15160529&output=JSONP&callback=getcount
The easiest way to get data is send a GET request via AJAX jQuery and get data in return.So this is how you will send your AJAX request:
HTML
<script src='jquery.js' type='text/javascript'/>
<script src='twittercount.js' type='text/javascript'/>
<span class='twittercount'></span>
jQuery (twittercount.js)
$.ajax({Replace your USER_ID and YOUR_API_KEY. Do not forget to add jQuery in your script.
type: "GET",
dataType: "jsonp",
url: "http://api.twittercounter.com/?twitter_id=USER_ID&apikey=YOUR_API_KEY&output=JSONP&callback=getcount",
success: function (data) {
var twitterfollowcount = data.followers_current;
$(".twittercount").html(twitterfollowcount);
}
});
Post A Comment:
0 comments: