How to Get Number of Twitter Followers Count without API?
In this post i going to share with you How to get total twitter followers count from twitter username without api authentication or token.
Yesterday i was working on my laravel 5 application and i require to get count total twitter followers from username. I did search a lot but i nothing get good on laravel or PHP, Finally i was thinking if it is possible by jquery ajax then it will be best. Again i search more and finally got something.
We can simply get number of twitter followers by using cdn widgets, So we are going to use bellow cdn with screen_name = twitter username as like bellow:
https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=twitterusername
In bellow full example you can see how it is work and how to get it. You can also see demo for your username.
index.html
<!DOCTYPE html>
<html>
<head>
<title>How to count Twitter Followers without authentication</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js"></script>
</head>
<body>
<div class="container">
<h3>Total Follower : <strong></strong></h3>
</div>
<script type="text/javascript">
var twitter_username = 'itsolutionstuff';
$.ajax({
url: "https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names="+twitter_username,
dataType : 'jsonp',
crossDomain : true
}).done(function(data) {
$("h3 strong").text(data[0]['followers_count']);
});
</script>
</body>
</html>
You can get as response on data variable like as bellow preview:
Data variable response
[
{
"following":false,
"id":"705077241378549760",
"screen_name":"itsolutionstuff",
"name":"It Solution Stuff",
"protected":false,
"followers_count":175,
"formatted_followers_count":
"175 followers",
"age_gated":false
}
]
I hope it can help you...
Video
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel 10 JQuery UI Ajax Autocomplete Search Example
- How to use jQuery in Angular 10 Projects?
- How to Set Radio Button Checked Based on Value using JQuery?
- How to Check If Checkbox is Checked or Not in JQuery?
- How to Install And Use JQuery in Angular?
- How to Remove Key Value from Array using JQuery?
- How to Get Last Element from Array using JQuery?
- JQuery Disable Right Click, Cut, Copy and Paste Example
- How to Remove Duplicate Object from Array in JQuery?
- JQuery Reload Page After 5 Seconds Example
- Laravel Twitter API using Thujohn/twitter Tutorial
- Bootstrap Digital Clock Picker with AM PM using Clockface JS
- How to Remove Comma from String in JQuery?
- Laravel Login with Twitter OAuth Tutorial