import urllib.request, ssl, socket, re

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
UA = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36"}

URLS = [
    ("gt-admission", "https://admission.gatech.edu"),
    ("gt-grad-admission", "https://gradadmission.gatech.edu"),
    ("gt-bs", "https://www.cc.gatech.edu"),
    ("gt-ece", "https://ece.gatech.edu"),
    ("gt-ise", "https://www.isye.gatech.edu"),
]

for name, url in URLS:
    try:
        req = urllib.request.Request(url, headers=UA)
        with urllib.request.urlopen(req, timeout=10, context=ctx) as r:
            body = r.read(4096)
            print(f"{name}: HTTP {r.status} | body {len(body)}")
    except urllib.error.HTTPError as e:
        print(f"{name}: HTTP {e.code}")
    except (socket.timeout, TimeoutError):
        print(f"{name}: TIMEOUT")
    except Exception as e:
        print(f"{name}: ERR {type(e).__name__} {str(e)[:60]}")
