Phantom Twitter Followers
Get the number of Twitter followers without a twitter app or API using PhantomJS or cURL

How to get the number of twitter followers without a twitter application on the twitter API

Option 1: PhantomJS

1. Download and extract PhantomJS

You can download the latest version from: http://phantomjs.org/download.html

2. Phantom Script

Copy this into a directory along with your PhantomJS binary and name it "weworkwefollow.js" (or something)

3. Command

test the script using this command; replace PATH_TO_PHANTOMJS with the path to the directory you've stored your phantomJS binary, give the twitter usernames as command line arguments to the script

[PATH_TO_PHANTOMJS]/phantomjs weworkwefollow.js [TWITTER_USERNAME] [TWITTER_USERNAME] [TWITTER_USERNAME]    

example:

phantomjs weworkwefollow.js weworkweplay pharrell nosajthing bibio

4. Output

the script returns a JSON, something like this:

{
    "weworkweplay":"135",
    "pharrell":"2.92M",
    "nosajthing":"36.8K",
    "bibio":"9,748"
}

5. Example using PHP

Small example in php that you can use in a cronjob or as a async javascript call on your site:

Option 2: cURL

As someone on reddit suggested you can also easily scrape a page using cURL

1. Install cURL

on ubuntu just apt-get install with:

sudo apt-get install curl

2. Single command line power!

curl https://twitter.com/weworkweplay | grep js-mini-profile-stat | grep followers | awk 'gsub(/.*title="|" class.*/,"")' >> output.txt

This will scrape the page and output the number of followers to a text file. You can then easily add this to your crontab and voila, you got yourself a twitter scraper!

Written by Thijs Bernolet