Created
November 17, 2017 21:58
-
-
Save Kagee/95c63353df4d259b963f3ec777f44d7a to your computer and use it in GitHub Desktop.
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
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