# -*- coding: utf-8 -*-
import urllib.request, ssl, json, sys, io, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
SCTX = ssl.create_default_context()
SCTX.check_hostname = False
SCTX.verify_mode = ssl.CERT_NONE

cands = [
    ("nyu-mpa-hpm", "https://bulletins.nyu.edu/graduate/public-service/programs/health-policy-and-management-mpa/"),
    ("jhu-bioethics", "https://e-catalogue.jhu.edu/arts-sciences/advanced-academic-programs/programs/bioethics-master-arts/"),
    ("jhu-intl-studies", "https://e-catalogue.jhu.edu/arts-sciences/advanced-academic-programs/programs/international-studies-master-arts/"),
    ("ut-adult-edu", "https://www.sgs.utoronto.ca/programs/adult-education/"),
    ("ut-higher-edu", "https://www.sgs.utoronto.ca/programs/higher-education/"),
]
hdr = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"}
out = {}
for key, url in cands:
    try:
        req = urllib.request.Request(url, headers=hdr)
        r = urllib.request.urlopen(req, timeout=15, context=SCTX)
        body = r.read()
        out[key] = (r.status, len(body), url)
        print(key, r.status, len(body))
    except Exception as e:
        out[key] = (-1, str(e)[:80], url)
        print(key, "FAIL", str(e)[:80])
json.dump(out, open("_probe68.json","w",encoding="utf-8"), ensure_ascii=False, indent=2)
