import re
h = open(r'D:\work buddy\2026-11-05-14-15-52\index_main.html', encoding='utf-8').read()
m = re.search(r'const PROGRAMS=\[', h)
start = m.end()
depth=1; i=start
while depth>0:
    c=h[i]
    if c=='[': depth+=1
    elif c==']': depth-=1
    i+=1
body = h[start:i-1]
recs = re.findall(r'\{id:"([^"]+)",s:"([^"]+)"', body)
from collections import defaultdict
byschool = defaultdict(list)
for sid, s in recs:
    byschool[s].append(sid)
for s in ['dartmouth','vanderbilt','uchicago','rice','emory','brown','notre','wustl','cornell','duke','gatech','ucsd','unc','uva','ucla','berkeley']:
    print(f'=== {s} ({len(byschool[s])}) ===')
    for sid in byschool[s]:
        print(' ', sid)
