Skip to content

Instantly share code, notes, and snippets.

@Kagee
Created November 17, 2017 21:58
Show Gist options
  • Save Kagee/95c63353df4d259b963f3ec777f44d7a to your computer and use it in GitHub Desktop.
Save Kagee/95c63353df4d259b963f3ec777f44d7a to your computer and use it in GitHub Desktop.
def get_cat_domains():
#whois = telnetlib.Telnet("whois.norid.no", 43)
#whois.write("-c utf-8 NNRI4O-NORID\n".encode('ascii'))
#result = whois.read_all()
#whois.close()
#print(result.decode('utf-8'))
a_file = open('whois.txt', encoding='utf-8')
s = a_file.read()
#print(s)
r = re.search('^Domains\.*: (.*)', s, re.MULTILINE)
#print("0: " + r.group(0))
if r:
domains = re.findall('[^ ]+', r.group(1))
print(domains[0], domains[-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment