Last active
December 11, 2015 02:54
-
-
Save adeolonoh/8156f072338b25117b69 to your computer and use it in GitHub Desktop.
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
''' | |
This script downloads the latest list of domains available | |
for backorder at https://www.pool.com/viewlist.aspx and | |
checks for really short domains or dictionary words. | |
More info at https://jell.com/blog/how-the-wrong-name-cost-our-startup/ | |
''' | |
import io | |
import requests | |
import zipfile | |
domain_zip_url = 'https://www.pool.com/Downloads/PoolDeletingDomainsList.zip' | |
domain_file = 'PoolDeletingDomainsList.txt' | |
dictionary_file = '/usr/share/dict/words' | |
# Grab the zip file and iterate over the domains | |
domains = [] | |
request = requests.get(domain_zip_url) | |
with zipfile.ZipFile(io.BytesIO(request.content)) as z: | |
with z.open(domain_file) as f: | |
for line in f: | |
# Get the domain name | |
domain = line.split(',', 1)[0].lower() | |
# Only look at .com domains | |
if not domain.endswith('.com'): | |
continue | |
# Get the word in the domain | |
word = domain.split('.', 1)[0] | |
# Only look at reasonable length words | |
if len(word) > 8: | |
continue | |
# Throw away some common prefixes and suffixes | |
if word.startswith(('get', 'try', 'use')) or word.endswith(('app', 'hq')): | |
continue | |
# Match any short domains, regardless of dictionary | |
if len(word) <= 4: | |
print word | |
else: | |
domains.append(word) | |
# Iterate over the dictionary looking for good matches | |
with open(dictionary_file) as f: | |
for line in f: | |
word = line.rstrip().lower() | |
if word in domains: | |
print word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment