Skip to content

Instantly share code, notes, and snippets.

@nathan-osman
Last active August 22, 2018 03:30
Show Gist options
  • Save nathan-osman/0180c19c7d2432563e29 to your computer and use it in GitHub Desktop.
Save nathan-osman/0180c19c7d2432563e29 to your computer and use it in GitHub Desktop.
Check Twitter for available usernames
test1
test2
...
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