Skip to content

Instantly share code, notes, and snippets.

@bryanhelmig
Created January 18, 2013 05:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bryanhelmig/5e647c9c39c99c0ebad3 to your computer and use it in GitHub Desktop.
Save bryanhelmig/5e647c9c39c99c0ebad3 to your computer and use it in GitHub Desktop.
import urllib, urllib2, csv, json
_check_domain = "http://ajaxwhois.com/lookup?d="
count = 0
words = """enter
words
here"""
for word in words.splitlines():
# build the url
check_domain = _check_domain
for tld in ['.com', ]: # add .net, .org if you want
check_domain += word + tld + ','
check_domain.rstrip(',')
# get the data
response = urllib2.urlopen(check_domain).read()
data = json.loads(response)
# check and print if available
for domain in data['r']:
print domain['d'] if domain['a'] else ''
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment