import json, re
t = json.load(open('todo_upgrade.json', encoding='utf-8'))
html = open('index_main.html', encoding='utf-8').read()
done = set(re.findall(r'en:"([^"]+)"', html))
seen = set()
cands = []
for x in t:
    s = x.get('s', ''); en = x.get('en', ''); cn = x.get('cn', ''); deg = x.get('deg', '')
    if not en: continue
    if en in done: continue
    key = (s, en)
    if key in seen: continue
    seen.add(key)
    cands.append((s, en, cn, deg, x.get('disc', ''), x.get('col', '')))
# show non-USC, non-JHU-AAP, non-NYU-SPS candidates
for c in cands:
    if c[0] in ('usc',): continue
    if c[0] == 'jhu' and 'AAP' in c[5]: continue
    if c[0] == 'nyu' and 'SPS' in c[5]: continue
    if c[3] == 'PhD': continue
    print(c)
