From df0e2fe863c18c673fecb7434389099a3d0dedce Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Thu, 17 Sep 2026 21:59:04 +0900 Subject: [PATCH] feat(site): publish summary.json alongside the catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TechAPI's homepage counted this repo by fetching catalog.json and reading .length. That stops working as satellites grow — game-catalog is ~1M records — so the page now reads a count from summary.json instead. --- .gitignore | 1 + site/build.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index da2305e..d889562 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ coverage.xml # Generated site catalog (rebuilt in CI) site/catalog.json site/history.json +site/summary.json # Local GitHub setup helpers (not part of the catalog) .github-setup/ diff --git a/site/build.py b/site/build.py index a3a05e4..236aa94 100644 --- a/site/build.py +++ b/site/build.py @@ -5,12 +5,14 @@ import json import subprocess import sys +from datetime import UTC, datetime from pathlib import Path ROOT = Path(__file__).resolve().parent.parent DATA = ROOT / "data" / "cpu" OUT = Path(__file__).resolve().parent / "catalog.json" HISTORY = Path(__file__).resolve().parent / "history.json" +SUMMARY = Path(__file__).resolve().parent / "summary.json" def git(*args: str) -> str: @@ -50,6 +52,15 @@ def main() -> int: ) OUT.write_text(json.dumps(records, indent=2) + "\n", encoding="utf-8") print(f"wrote {OUT} ({len(records)} ES records)") + # TechAPI's homepage counts satellites from summary.json rather than by + # downloading a record listing — game-catalog is ~1M records, so reading + # a catalog's .length stopped being viable there. + summary = { + "count": len(records), + "generated_at": datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%SZ"), + } + SUMMARY.write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8") + print(f"wrote {SUMMARY} ({len(records)} records)") history = build_history() HISTORY.write_text(json.dumps({"points": history}, indent=2) + "\n", encoding="utf-8") print(f"wrote {HISTORY} ({len(history)} points)")