v0.2.0

快速開始

最後更新


本頁說明從原始碼建置 go-rss-reader、加入第一個訂閱源並讀到第一篇全文的完整步驟。

前置需求


項目需求
Go1.24.3 以上(go.mod)
C 編譯器gcc 或 clang,且 CGO_ENABLED=1;github.com/mattn/go-sqlite3 為 CGO 套件
終端機支援色彩顯示
OpenAI API 金鑰選用;只有 LLM 新聞概要需要
開啟原文macOS open、Linux xdg-open、Windows cmd /c start

安裝


  1. git clone https://github.com/pardnchiu/go-rss-reader.git
  2. cd go-rss-reader
  3. CGO_ENABLED=1 go build -o RSSReader ./cmd/cli

go.mod 的 module 名稱為 rss-reader,不是 GitHub 路徑,因此 go install github.com/pardnchiu/go-rss-reader/... 無法使用,只能從原始碼建置或以 go run ./cmd/cli 直接執行。

第一次執行


  1. ./RSSReader

  1. 啟動後沒有任何訂閱源。按兩次 Tab,焦點會從 News List 經 Preview 移到 Command
  2. 輸入下列指令並按 Enter:
    1. add https://feeds.bbci.co.uk/news/rss.xml
  3. 按 Ctrl+R 立即抓取;狀態列顯示 Found N new articles, getting full content... 後,背景開始逐篇萃取全文
  4. 按兩次 Tab(Command → Summary → News List)回到 News List,以 ↑/↓ 移動,Preview 會顯示萃取後的全文
  5. 按 Ctrl+O 以預設瀏覽器開啟原文,Ctrl+C 結束程式

在專案目錄內執行時(工作目錄有 go.mod),資料庫會建立在 ./rss.db;其他位置的判斷規則見 設定。

啟用 LLM 概要


在 Command 欄輸入:
  1. apikey sk-xxxxxxxxxxxxxxxxxxxxxxxx

下一次抓到新文章並完成全文萃取後,Summary 欄會出現繁體中文新聞概要。觸發條件與送出內容見 LLM 新聞概要。
EN