From a3f276f502522cf3b81f4d10c1504d372bcfad5f Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 24 Oct 2022 09:06:30 +0300 Subject: Add initial scan script --- scan.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scan.py (limited to 'scan.py') diff --git a/scan.py b/scan.py new file mode 100644 index 0000000..34c65d8 --- /dev/null +++ b/scan.py @@ -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 -- cgit v1.3.1