# -*- coding: utf-8 -*-
import json, re, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
todo = json.load(open("todo_upgrade.json", encoding="utf-8"))
idx = open("index_main.html", encoding="utf-8").read()
progs = idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]
# all existing en names
existing_en = set(re.findall(r'en:"([^"]+)"', progs))
# GaTech MS not in PROGRAMS
gt = [t for t in todo if t["s"]=="gatech" and t["deg"].startswith("MS")]
new = [t for t in gt if t["en"] not in existing_en]
print("GaTech MS total:", len(gt), "not in PROGRAMS:", len(new))
for t in new:
    print(" ", t["deg"], t["en"], "|", t["det"])
