Skip to content

Instantly share code, notes, and snippets.

@jatrost
Created June 26, 2020 21:16
Show Gist options
  • Save jatrost/38297ded8bc286fed25e6813ed41d472 to your computer and use it in GitHub Desktop.
Save jatrost/38297ded8bc286fed25e6813ed41d472 to your computer and use it in GitHub Desktop.
import tldextract
import sys
for line in sys.stdin:
try:
sld = tldextract.extract(line.strip()).registered_domain
if sld:
print(sld)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment