import json, re
with open('index_main.html', encoding='utf-8') as f: html = f.read()
m = re.search(r'const PROGRAMS\s*=\s*\[([\s\S]*?)\n\];', html)
body = m.group(1)
entries = re.findall(r'\{id:"([^"]+)"[^}]*?s:"([^"]+)"[^}]*?en:"([^"]+)"[^}]*?deg:"([^"]+)"', body)
have = {(s, en.lower().strip()) for (i,s,en,deg) in entries}
print('PROGRAMS entries:', len(entries), 'unique (s,en):', len(have))
with open('todo_upgrade.json', encoding='utf-8') as f: todo = json.load(f)
print('Todo total:', len(todo))
remaining = [t for t in todo if (t.get('s',''), t.get('en','').lower().strip()) not in have]
print('Remaining:', len(remaining))
prio = ['Computer','Electrical','Finance','Econ','Business Analytics','Data Sci','Statistic','Mech','Bio','Management','Accounting','Marketing','Information','Applied Math','Math','Physics','Chemistry']
for p in prio:
    items = [r for r in remaining if p.lower() in (r.get('disc','') or '').lower() or p.lower() in (r.get('col','') or '').lower()]
    if items:
        print(f'--- {p}: {len(items)} ---')
        for r in items[:10]:
            print(' ', r.get('s'), '|', r.get('en'), '|', r.get('deg'), '|', r.get('disc'), '|', r.get('col'))
