演算本日關鍵產業新聞的拓樸。
This project is configured as Synanews and pushes generated artifacts to the GitHub Pages repository for user lcslin.
lcslin/lcslin.github.ioorigin -> https://github.com/lcslin/lcslin.github.io.gitmaingen-daily-graph.py fetches headlines from https://www.itis.org.tw/member/DailyNews.aspx, sends a numbered title list to an LLM, writes the returned graph to a dated JSON file, and embeds that day’s data into daily-graph.html.
The current implementation is headline-driven. It does not scrape article summaries or full article content.
Environment variables are loaded from .env with python-dotenv.
Required:
TAITRA_API_KEYOptional:
TAITRA_BASE_URL default: https://runway.taitra.aiMODEL default: claude-sonnetGIT_PUSH_BRANCH for commit.shGIT_COMMIT_MESSAGE for commit.shGIT_DEPLOY_KEY_PATH for commit.shRecommended secret file location for cron:
~/.config/synanews.envRunning the generator produces:
YYYY-MM-DD.json: graph data for the selected daydaily-graph.html: HTML generated from daily-graph-template.html with that day’s data embeddedThe JSON normally includes:
nodeslinksnewsDatabasetitleToUrlpython gen-daily-graph.py
python gen-daily-graph.py --today
python gen-daily-graph.py --date 20260206
Behavior:
--today: fetch DailyNews.aspx--date YYYYMMDD: fetch DailyNews.aspx?Day=YYYYMMDD2026-02-06.json-o/--output is not supported by the current implementation.
requests.Session()dailynews-link-itemtitle, url, and contentcontent is the same as titleentity-graph-prompt.mdnewsDatabasetitleToUrl mapping is added to the output JSONdaily-graph-template.htmlcron-entry.sh
~/.config/synanews.env if present.envgen-daily-graph.pycommit.shcommit.sh
*.html and *.jsonlcslin/lcslin.github.io~/.config/synanews.env before repo-local .envGITHUB_TOKEN or GH_TOKEN, then gh auth token, then plain git remote authFor local cronjob execution, the preferred setup is to keep secrets outside the repo and let the scripts load them from a fixed path.
Recommended ~/.config/synanews.env content:
TAITRA_API_KEY=...
TAITRA_BASE_URL=https://runway.taitra.ai
GITHUB_TOKEN=...
Recommended crontab entry:
0 8 * * * /Users/cslin/app-dev/Synanews/cron-entry.sh >> /Users/cslin/app-dev/Synanews/cron.log 2>&1
commit.sh still supports gh auth token as a fallback, but a fixed env file is more predictable for cron.
daily-graph-template.html, which must exist beside the Python scriptchmod 600