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
#!/usr/bin/env python3 | |
import requests, idna | |
PUBLIC_SUFFIX_URL = 'https://publicsuffix.org/list/public_suffix_list.dat' | |
DELEGATED_TLDS_URL = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | |
current_suffixes = [x for x in requests.get(PUBLIC_SUFFIX_URL).text.split('\n') if x and not x.startswith('//')] | |
current_tlds = [idna.decode(x) for x in requests.get(DELEGATED_TLDS_URL).text.split('\n') if x and not x.startswith('#')] |
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
def cctld_to_flag(domain): | |
for letter in domain: | |
print(chr(ord(letter)+127365), end='') | |
cctld_to_flag('au') |
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
### Keybase proof | |
I hereby claim: | |
* I am kjd on github. | |
* I am kjd (https://keybase.io/kjd) on keybase. | |
* I have a public key whose fingerprint is E6D9 BAAD 8BE6 9E14 F383 7E49 D9B1 54C1 4A6C 23DC | |
To claim this, I am signing this object: |
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
#!/usr/bin/env python | |
# | |
# Base 58 function used by Flickr e.g. photo id 2360374815 becomes flic.kr/p/4Azxcv | |
def base58(i): | |
chars = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' | |
o = '' | |
while (1): |