myspoti
Native Android client for Spotify, built with Jetpack Compose
每小時自動蒐集台灣本地、國際、財經貿易、科技產業的重大新聞
Translation pending
MediaTypeScript · CSSGitHub @Tomwu229622OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Collect More News Channel
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗每小時自動蒐集 台灣本地 / 國際 / 財經貿易 / 科技產業 / 資安 五大類重要新聞, 以 RSS/API 為主、Playwright 補強,存入 Neon Postgres,並提供網頁瀏覽、關鍵字篩選、 AI 重要性評分與每日摘要推播。
npm install
# 設定資料庫連線:複製範本後,把 .env 裡的 DATABASE_URL 填上 Neon 連線字串
Copy-Item .env.example .env
npm run db:init # 建立資料表
npm run collect # 抓一次新聞
npm run dev # 開 http://localhost:3000
若要使用 Playwright 補強沒有 RSS 的來源,另外執行一次
npx playwright install chromium。
npm run dev
開啟 http://localhost:3000 — 可瀏覽、分類、搜尋關鍵字、只看重大、右上角「立即更新」手動抓取。
另開一個終端機:
npm run worker
排程器會:
COLLECT_CRON)DIGEST_CRON)想讓它常駐、開機自動啟動,可用 Windows「工作排程器」設定開機執行
npm run worker, 或用 pm2 等程序管理工具。
npm run collect # 手動抓一次
npm run translate # 手動補翻既有未翻譯的英文新聞
npm run digest # 手動產生並推播每日摘要
| 變數 | 說明 |
|---|---|
DATABASE_URL | (必填) Neon Postgres 連線字串,本機與雲端共用 |
ANTHROPIC_API_KEY | 填入後啟用 Claude AI 重要性評分與摘要;不填則用關鍵字判斷 |
AI_MAX_PER_RUN | 每次蒐集最多送幾則給 AI(預設 40,控制成本) |
RUNWAY_API_KEY | 填入後啟用英文新聞自動翻譯(走公司 LLM gateway);不填則不翻譯 |
RUNWAY_BASE_URL | 公司 LLM gateway 位址(預設 https://runway.taitra.ai) |
RUNWAY_MODEL | 逗號分隔的模型清單,依序嘗試(預設 claude-haiku,gpt-5-chat) |
TRANSLATE_MAX_PER_RUN | 每次蒐集最多翻幾則(預設 80,控制成本) |
TEAMS_WEBHOOK_URL | Teams 傳入 Webhook,設定後每日摘要推播到 Teams |
SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / DIGEST_EMAIL_TO / DIGEST_EMAIL_FROM | Email 推播設定 |
RETENTION_DAYS | 只保留最近 N 天的新聞,更舊的在每次蒐集時刪除(預設 30) |
COLLECT_CRON | 蒐集排程(預設 0 * * * *,每小時) |
DIGEST_CRON | 摘要排程(預設 0 8 * * *,每天 08:00) |
推播優先序:Teams → Email → console(都沒設定就只印在畫面)。
編輯 src/lib/sources.ts。優先用 RSS:
{ name: '來源名稱', category: '科技產業', rss: 'https://example.com/feed' }
沒有 RSS 的網站,用 Playwright 補強:
{
name: '某網站',
category: '國際',
scrape: {
url: 'https://example.com/news',
itemSelector: 'article.item', // 每則新聞容器
titleSelector: 'h2 a', // 標題(相對 item)
// linkSelector 省略時自動取容器內第一個 <a>
},
}
某個來源抓取失敗不會影響其他來源。
編輯 src/lib/classify.ts 的 KEYWORD_WEIGHTS(關鍵字權重)與 MAJOR_THRESHOLD(重大門檻)。
改 RETENTION_DAYS(預設 30)。
src/
lib/
types.ts 型別定義
sources.ts 新聞來源清單 ← 想加來源改這裡
db.ts Neon Postgres 存取(@neondatabase/serverless)
rss.ts RSS 抓取
scrape.ts Playwright 補強抓取
classify.ts 關鍵字分類與重大判斷 ← 想調權重改這裡
ai.ts Claude AI 評分與摘要
translate.ts 英文新聞翻譯(走公司 LLM gateway)
collector.ts 蒐集編排(抓取→去重→分類→AI→翻譯→入庫)
digest.ts 每日摘要生成與推播
env.ts 載入 .env(給 worker/scripts 用)
scripts/
collect-once.ts 手動蒐集
translate-once.ts 手動補翻既有未翻譯新聞
digest-once.ts 手動摘要
init-db.ts 建立資料表
worker.ts 本機 node-cron 排程器
app/ Next.js 網站(App Router)
page.tsx 新聞列表頁
api/news JSON API
api/collect 手動觸發蒐集
.github/workflows/
collect.yml 雲端每小時蒐集(GitHub Actions)
digest.yml 雲端每日摘要(GitHub Actions)
把網站放上 Vercel、排程交給 GitHub Actions、資料庫用 Neon, 即可全雲端、隨時隨地觀看,不必開自己的電腦。
👉 完整步驟見 DEPLOY.md
本機的
npm run worker(node-cron)與雲端的 GitHub Actions 是兩種排程方式,擇一即可: 自己電腦長開就用 worker;要全雲端就用 GitHub Actions。