# -*- 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")
t=open("index_main.html",encoding="utf-8").read()
prog=t[t.find("const PROGRAMS="):t.find("const CATD=")]
catd=t[t.find("const CATD="):t.find("const VERIFIED_DETAILS=")]
prog_dets=set(re.findall(r'url:"([^"]+)"',prog))
todo=json.load(open("todo_upgrade.json",encoding="utf-8"))
items=todo["list"] if isinstance(todo,dict) else todo
print("todo total",len(items))
prio={"cs":0,"eng":1,"biz":2,"sci":3,"med":4,"soc":5,"edu":6,"art":7}
def key(x):
    return prio.get(x.get("disc",""),9)
rows=[]
for x in items:
    det=x.get("det","")
    if det in prog_dets: continue
    rows.append(x)
rows.sort(key=key)
for x in rows[:40]:
    print(x.get("s"),"|",x.get("disc"),"|",x.get("deg"),"|",x.get("en","")[:55],"|",os.path.basename(x.get("det","")))
