Remove duplicate e-mail addresses and nameservers

master
Sven Slootweg 12 years ago
parent bf2f28c02f
commit 812d4812cb

@ -128,6 +128,12 @@ def whois(domain):
if data['creation_date'] is not None:
data['creation_date'] = parse_dates(data['creation_date'])
if data['name_servers'] is not None:
data['name_servers'] = remove_duplicates(data['name_servers'])
if data['emails'] is not None:
data['emails'] = remove_duplicates(data['emails'])
return data
def parse_dates(dates):
@ -194,3 +200,12 @@ def parse_dates(dates):
return parsed_dates
else:
return None
def remove_duplicates(data):
cleaned_list = []
for entry in data:
if entry not in cleaned_list:
cleaned_list.append(entry)
return cleaned_list

Loading…
Cancel
Save