# -*- coding: utf-8 -*-
import urllib.request, ssl, socket, io, sys, 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
socket.setdefaulttimeout(12)
urls = [
    ("UT SGS Astronomy", "https://sgs.utoronto.ca/programs/astronomy-and-astrophysics/"),
    ("CMU MSPM", "https://www.cmu.edu/scratchools/masters-in-product-management/index.html"),
    ("CMU MSPM-v2", "https://www.cmu.edu/integrated-master-in-product-management/"),
    ("USC catalogue", "https://catalogue.usc.edu/"),
    ("USC catalogue CS", "https://catalogue.usc.edu/graduate/engineering/computer-science/"),
    ("USC catalogue Stats", "https://catalogue.usc.edu/graduate/college-letters-arts-sciences/mathematics/statistics/"),
    ("NYU SPS Mgmt Analytics", "https://www.sps.nyu.edu/homepage/academics/schools-departments/school-of-professional-students/graduate-degree-programs/management-and-analytics-ms.html"),
    ("NYU SPS Integrated Marketing", "https://www.sps.nyu.edu/homepage/academics/schools-departments/school-of-professional-students/graduate-degree-programs/integrated-marketing-ms.html"),
    ("NYU SPC Project Mgmt", "https://www.sps.nyu.edu/homepage/academics/schools-departments/school-of-professional-students/graduate-degree-programs/project-management-ms.html"),
    ("UT MMI Management Innovation", "https://sgs.utoronto.ca/programs/management-innovation/"),
]
for name, u in urls:
    try:
        req = urllib.request.Request(u, headers={"User-Agent":"Mozilla/5.0"})
        r = urllib.request.urlopen(req, context=SCTX, timeout=12)
        body = r.read()
        print(f"{r.status} {len(body):>7} {name}  {u}")
    except Exception as e:
        print(f"ERR {type(e).__name__:>10} {name}  {u}  {str(e)[:80]}")
