Created
April 7, 2012 03:12
Revisions
-
elazar revised this gist
Apr 7, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,6 @@ def filter_tlds(x): return x.startswith(".") domain_tld = domain + tld try: socket.gethostbyname(domain_tld) print(domain_tld + ": taken") except: print(domain_tld + ": available") -
elazar created this gist
Apr 7, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/usr/bin/env python import sys import socket import itertools def filter_tlds(x): return x.startswith(".") tlds = set(filter(filter_tlds, sys.argv[1:])) non_tlds = set(sys.argv[1:]).difference(tlds) for permutation in itertools.permutations(non_tlds): domain = "".join(permutation) for tld in tlds: domain_tld = domain + tld try: socket.gethostbyname(domain_tld) print domain_tld + ": taken" except: print domain_tld + ": available"