Last active
August 29, 2015 14:03
-
-
Save BYK/7e11eefd74aafa5693e8 to your computer and use it in GitHub Desktop.
Fetch the most current list of TLDs and create a Python module from them
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
echo 'TLDS = (' > $1 && | |
curl -f -sS https://data.iana.org/TLD/tlds-alpha-by-domain.txt -L | | |
awk '{print tolower($0)}' | | |
grep '^[[:alnum:]\-]\{1,63\}$' | sed 's/^.*$/"&",/g' >> $1 && | |
echo ')' >> $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment