Skip to content

Instantly share code, notes, and snippets.

@guerrerocarlos
Created August 21, 2012 06:46
Show Gist options
  • Save guerrerocarlos/3412745 to your computer and use it in GitHub Desktop.
Save guerrerocarlos/3412745 to your computer and use it in GitHub Desktop.
Python Whois Robot
import itertools
import subprocess
archivo = open("disponibles","a")
for LENGTH in range(3,8):
a = itertools.product("ABCDEFGHIJKLMNOPQRSTUVWXYZ",repeat=LENGTH)
for each in a:
domain = "".join(each)+".com"
print domain
pos = " ".join(subprocess.Popen(['whois', domain], stdout=subprocess.PIPE).stdout.readlines()).find("No match")
if pos > -1:
print "DISPONIBLE"
archivo.write(domain+",DISPONIBLE\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment