# -*- coding: utf-8 -*-
import json, io, os, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
OUT = r"D:\work buddy\2026-11-05-14-15-52\_r350_specs"
ADD = {
 "jhu-c785e3d": [
  "<p>Core Course - Required: AS.430.800 Capstone for Geographic Information Systems (3 credits); Core Courses - Customizable (select three): AS.430.600 Web GIS, AS.430.601 Geographic Information Systems (GIS), AS.430.603 Geospatial Statistics, AS.430.604 Spatial Analytics, AS.430.606 Programming in GIS.</p>",
  "<p>口径提示：本项目按门计费，官方只给单门费率区间，本页不代算 10 门总价；兼读身份与签证所需的线下课时要求须与 AAP 逐条确认。</p>",
 ],
 "jhu-energy": [
  "<p>Core Courses - Required (9 credits): AS.425.601 Principles and Applications of Energy Technology, AS.425.602 Science of Climate Change and its Impact, AS.425.800 Capstone Projects in Energy and Environmental Sciences; Core Courses - Customizable (6 credits, select two): AS.425.603 Climate Change Policy Analysis, AS.425.604 Energy &amp; Climate Finance, AS.425.605 Introduction to Energy Law &amp; Policy.</p>",
  "<p>口径提示：本项目按门计费，官方只给单门费率区间，本页不代算 10 门总价；选修与环境科学及政策（ESP）交叉课以当年课程表标注为准。</p>",
 ],
}
for pid, paras in ADD.items():
    p = os.path.join(OUT, pid + ".json")
    s = json.load(open(p, encoding="utf-8"))
    for c in s["cards"]:
        if c.get("title") == "官网原文要点摘录（英文原文，便于核对）":
            c["text"] = c["text"] + "".join(paras)
    json.dump(s, open(p, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
    print(pid, "extended")
