Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import re
- addr_s = open('unregistered.txt', 'r')
- addr_m = open('mails_to_send.txt', 'r')
- addr_c = open('cleared.txt', 'w')
- def match_domain(domain):
- match = re.search(r'([\w.-]+)@([\w.-]+)', domain )
- domain_name = str(match.group(2))
- return domain_name
- domains_all = []
- domains_bad = []
- for line in addr_s:
- try :
- line = line.replace("\n","")
- print match_domain(line)
- domains_bad.append(match_domain(line))
- except :
- print "Wrong Domain Name : " + line
- print "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
- for line in addr_m:
- try :
- line = line.replace("\n","")
- print match_domain(line)
- domains_all.append(match_domain(line))
- except :
- print "Wrong Domain Name : " + line
- match_counter = 0
- for domain in domains_all:
- if domain in domains_bad:
- print "Match : " + domain
- match_counter +=1
- else :
- print "Unique Domain : " + domain
- addr_c.write("info@" + domain + "\n")
- print "###############################"
- print "Bad Domains : " + str(len(domains_bad))
- print "Good Domains : " + str(len(domains_all))
- print "Matching Domains : " + str(match_counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement