# -*- coding: utf-8 -*-
import io, sys, os, re, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
todo=json.load(open("todo_upgrade.json",encoding="utf-8"))
idx=open("index_main.html",encoding="utf-8").read()
prog=idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]
prog_dets=set(re.findall(r'url:"(details/[^"]+)"',prog))
for t in todo:
    if t["s"] in ("rice","cornell","cmu","duke","umich","illinois"):
        dup="DUP" if t["det"] in prog_dets else "NEW"
        print(dup,t["s"],t.get("disc",""),t.get("deg",""),"|",t["en"][:40],"|",os.path.basename(t["det"]))
