# -*- coding: utf-8 -*-
import concurrent.futures, requests, pathlib, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52")
CACHE = BASE / "cache"
UA = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36"}
SLUGS = {
 "ece": "electrical-computer-engineering-ms",
 "qcf": "quantitative-computational-finance-ms",
 "sce": "supply-chain-engineering-ms",
 "ie": "industrial-engineering-ms",
 "or": "operations-research-ms",
 "cse": "computational-science-engineering-ms",
 "mse": "materials-science-engineering-ms",
 "math": "mathematics-ms",
 "urban": "urban-analytics-ms",
 "phys": "physics-ms",
 "chem": "chemistry-ms",
 "ce": "civil-engineering-ms",
 "ae": "aerospace-engineering-ms",
 "nre": "nuclear-engineering-ms",
 "cheme": "chemical-bimolecular-engineering-ms",
}
def get(item):
    k, slug = item
    u = f"https://catalog.gatech.edu/programs/{slug}/"
    try:
        r = requests.get(u, headers=UA, timeout=12)
        (CACHE / f"gt2-{k}.html").write_text(r.text, encoding="utf-8", errors="replace")
        return k, r.status_code, len(r.text)
    except Exception as e:
        return k, "ERR", str(e)[:50]
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as ex:
    for k, s, n in ex.map(get, SLUGS.items()):
        print(f"{k:6} {s} {n} {SLUGS[k]}")
