/gist:82c4fe68bac30f4ed653 Secret
Created
July 11, 2014 17:34
Star
You must be signed in to star a gist
This file contains 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
import io | |
import sys | |
def read_file(path, data): | |
with io.open(path) as file: | |
for domain in file.readlines(): | |
data.add(domain.strip().lower()) | |
def write_file(data, path='whitelist.txt'): | |
with io.open(path, 'w') as file: | |
file.write('\n'.join(sorted(data))) | |
if __name__ == '__main__': | |
domains = set() | |
for path in sys.argv[1:]: | |
read_file(path, domains) | |
write_file(domains) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment