Created
August 27, 2012 12:12
-
-
Save 0xv/3487910 to your computer and use it in GitHub Desktop.
check available username on twitter
This file contains hidden or 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
#!/usr/bin/env python | |
'''@0xv''' | |
import json, urllib2 | |
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1' | |
username = raw_input('username: ') | |
url = 'https://www.twitter.com/users/username_available?suggest=1&username=%s&full_name=&email=&suggest_on_username=true&context=front&custom=1' % (username) | |
req = urllib2.Request(url) | |
get = urllib2.urlopen(req).read() | |
resp = json.loads(get) | |
if "available" in resp["reason"]: | |
print '[+] %s %s' % (username, resp["msg"]) | |
elif "error" in resp: | |
print '[!] %s %s' % (username, resp["msg"]) | |
else: | |
print '[-] %s %s' % (username, resp["msg"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment