Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import re
- import urllib
- # You must download All Slovak Domains Dump from Slovak National Domain Registry : SK-NIC
- # https://www.sk-nic.sk/documents/domeny_1.txt
- # You can try direct file processing with python instaed of opening local downloaded file :
- # link = "https://www.sk-nic.sk/documents/domeny_1.txt"
- # file = urllib.urlopen(link)
- # If you want direct url file processing then comment 2 lines below and uncomment 2 lines above.
- file = open('domeny_1.txt','r')
- fo = file.readlines()
- print ("Parsing.....")
- domains = []
- for line in fo:
- reg_vyraz = re.search('[^;]*', str(line)).group()
- domains.append(reg_vyraz)
- print reg_vyraz
- print ("Parsing complete. Writing File")
- fileout = open('domeny_2.txt','wa')
- for domain in domains:
- fileout.write(domain+"\n")
- print ("Generating info@domain.sk e-mail addresses...")
- fileout.write("\n\n\n ################# \n info@domain.sk \n ################# \n\n\n")
- for domain in domains:
- fileout.write("info@"+domain+"\n")
- print ("Generating domain@domain.sk e-mail addresses...")
- fileout.write("\n\n\n ################# \n domain@domain.sk \n ################# \n\n\n")
- for domain in domains:
- prefix = domain.replace('.sk','')
- fileout.write(prefix+"@"+domain+"\n")
- print ("Process Finished... Now Exiting")
- file.close()
- fileout.close()
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement