How to retrieve number of twitter followers count without authentication or api ?
In this post we will give you information about How to retrieve number of twitter followers count without authentication or api ?. Hear we will give you detail about How to retrieve number of twitter followers count without authentication or api ?And how to use it also give you demo for it if it is necessary.
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 >
<h3>Total Follower : <strong></strong></h3>
</div>
<script type="text/javascript">
var twitter_username = 'onlinecode';
$.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":"onlinecode",
"name":"It Solution Stuff",
"protected":false,
"followers_count":175,
"formatted_followers_count":
"175 followers",
"age_gated":false
}
]
I hope it can help you…
Video
Hope this code and post will helped you for implement How to retrieve number of twitter followers count without authentication or api ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs