# -*- coding: utf-8 -*-
import sys, io, re, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = r"D:\work buddy\2026-11-05-14-15-52"
h = open(BASE + r"\index_main.html", encoding="utf-8", errors="replace").read()
seg = re.search(r"PROGRAMS\s*=\s*\[(.*?)\n\s*\];", h, re.S).group(1)
ids = ["wlu-cs-mmath", "wlu-stat-mmath", "wlu-biostat-mmath", "wlu-mdsai", "wlu-ds-mmath",
       "brown-cs-scm", "brown-cs-scm-aiml-track"]
for b in re.split(r'(?=\bid:")', seg):
    for i in ids:
        if 'id:"' + i + '"' in b:
            print(b.strip().replace("\n", " ")[:520])
            print("---")
