Python is awesome, not because everyone is saying it. It’s awesome because python allows you to do almost everything you want.
Just few days back I was trying to search user name of those, whose twitter handle starts from @1 to @100. So, I just wrote a quick python script that performs the same task and shows you all the user name in your terminal.
Here is the code :
import urllib2 from BeautifulSoup import BeautifulSoup for x in xrange(1,100): print BeautifulSoup(urllib2.urlopen("https://www.twitter.com/"+str(x))).title.string x += 1
Now, save this code as twitter.py and run it via terminal.
If you get any error regarding modules then try :
- sudo pip install urllib2
- sudo pip install BeautifulSoup