import json, re
with open('todo_upgrade.json','r',encoding='utf-8') as f:
    todo = json.load(f)
print('total todo:', len(todo))
with open('index_main.html','r',encoding='utf-8') as f:
    html = f.read()
existing_ids = set(re.findall(r'\{id:"([^"]+)"', html))
print('existing ids:', len(existing_ids))
remaining = [t for t in todo if t.get('id','') not in existing_ids]
print('remaining not in PROGRAMS:', len(remaining))
for i,t in enumerate(remaining[:30]):
    print(i, t.get('id',''), t.get('s',''), t.get('n',''), '|', t.get('en',''))
