diff options
| author | Yuval Adam <_@yuv.al> | 2022-10-24 09:06:30 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2022-10-24 09:06:30 +0300 |
| commit | a3f276f502522cf3b81f4d10c1504d372bcfad5f (patch) | |
| tree | f8d55e3d73757b747ba54b0db913ee395d2ad07d /scan.py | |
| parent | 3f53790f55f8abc2a5cc635a1fe58568ecfd6184 (diff) | |
Add initial scan script
Diffstat (limited to 'scan.py')
| -rw-r--r-- | scan.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +import requests + +from pathlib import Path + +ROOT_PATH = Path(__file__).parent + +DATA_DIR = ROOT_PATH / "data" + +TLDS_URL = "https://data.iana.org/TLD/tlds-alpha-by-domain.txt" + +with open(DATA_DIR / "tlds.txt", "w") as f: + res = requests.get(TLDS_URL) + tlds = [tld.lower() for tld in res.text.split("\n")[1:] if len(tld) < 4] + f.write("\n".join(tlds).strip())
\ No newline at end of file |
