Lightweight Python toolkit that auto-posts a daily, curated GitHub-trending / tech-news update to Instagram + a Facebook Page + Threads — one local image, three platform-native captions, one command. Images are generated locally with ComfyUI (photoreal sci-fi ↔ anime, randomized).
自動把每日「GitHub trending / 科技新聞」策展貼文發到 IG + FB 粉專 + Threads:本機生圖、三平台各自文案、一鍵發完。中文說明見下
Author: Lee-unhn · narrative formulas adapted from the open-source social-post skill by Hao (MIT).
flowchart LR
A([Trending source<br/>GitHub · Hacker News]):::input --> F[/fetch_topic.py/]:::proc
F --> C[/captions<br/>one per platform/]:::proc
F --> G[/gen_image.py/]:::proc
M[(ComfyUI<br/>DreamShaper · Animagine)]:::res --> G
C --> P
G --> U[(ImgBB<br/>public URL)]:::res --> P
subgraph P[publish_all.py]
IG[Instagram]:::out
FB[Facebook Page]:::out
TH[Threads]:::out
end
P --> N[/notify.py<br/>email result/]:::proc
classDef input fill:#74c7ec,color:#1e1e2e
classDef proc fill:#f9e2af,color:#1e1e2e
classDef res fill:#a6e3a1,color:#1e1e2e
classDef out fill:#f5c2e7,color:#1e1e2e
- Three platforms, one call —
publish_all.pyuploads the image once and posts IG (+ first-comment link), FB Page, and Threads, each with its own caption. - Local image generation —
gen_image.pydrives a local ComfyUI; randomly switches between photoreal sci-fi (DreamShaper) and anime (Animagine), randomizes the character, and you vary the action per post. - Topic discovery —
fetch_topic.pypulls GitHub trending (official Search API) and Hacker News, with simple URL de-duplication. - Result emails —
notify.py/emailer.pysend a one-line success/failure report so a missed day is visible. - No secrets in code — everything reads from a local
.env(gitignored).
cp .env.example .envand fill it in (see comments in the file).- Meta tokens: convert your IG to a Creator/Business account, link it to a Facebook Page, and generate a token with
instagram_content_publish+pages_manage_posts. Threads uses its own token (Threads use-case "User token generator"). - Image host: a free ImgBB key.
- Local ComfyUI running on
127.0.0.1:8188withdreamshaper-xl-turboand/oranimagine-xl-4.0checkpoints. - Python 3.10+ (standard library only — no pip installs).
# generate an image (style random; --style scifi|comic to force)
python gen_image.py --prompt "developer workspace, walking, wide shot" --out out.png
# post one image + three captions to all platforms
python publish_all.py --image out.png \
--ig-caption "..." --fb-caption "..." --threads-text "..." \
--link "github.com/owner/repo"
# Threads text-only with a link preview card
python publish_threads.py --text "..." --link "https://github.com/owner/repo"Run it daily with your OS scheduler (cron / Task Scheduler) or a Claude Code scheduled task.
- Personal Facebook profiles have no publishing API — only Pages do. This toolkit targets a Page + IG + Threads.
- API-posted Instagram does not auto-cross-post to FB/Threads, so each platform is posted independently.
每天自動把一則「GitHub trending / 科技新聞」策展內容,發到 Instagram + Facebook 粉專 + Threads:本機用 ComfyUI 生圖(科幻寫實 ↔ 動漫隨機切換、人物隨機、動作每天變),三平台各寫一版文案,一個指令發完,發完寄一封成功/失敗回報信。
- 三平台一次發:
publish_all.py圖只上傳一次,IG(+第一則留言放連結)、FB 粉專、Threads 各自文案。 - 本機生圖:
gen_image.py接本機 ComfyUI,隨機切寫實/動漫風與人物外型。 - 題材探索:
fetch_topic.py抓 GitHub trending + Hacker News,含 URL 去重。 - 結果回報:
notify.py/emailer.py寄一行成功/失敗,漏發看得到。 - 程式不含金鑰:全部讀本地
.env(已 gitignore)。
設定見上方英文 Setup;敘事公式改編自 Hao 的 social-post skill。
MIT © 2026 Lee-unhn. Narrative formulas adapted from Hao's social-post skill (MIT).