Last active
August 22, 2018 03:30
-
-
Save nathan-osman/0180c19c7d2432563e29 to your computer and use it in GitHub Desktop.
Check Twitter for available usernames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test1 | |
test2 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from urllib2 import urlopen | |
for l in open('twitter.txt', 'r'): | |
l = l.strip() | |
if not l: | |
break | |
try: | |
urlopen('http://twitter.com/%s' % l.lower()).read() | |
print '%20s is NOT available!' % l | |
except: | |
print '%20s is available!' % l | |
sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment