iT邦幫忙

2025 iThome 鐵人賽

DAY 13
0
DevOps

30 天自動化高手養成:玩轉 n8n 工作流系列 第 13

Day13 DeepL + n8n 教學 — RSS 自動翻譯並推送到 Discord

  • 分享至 

  • xImage
  •  

在 Day13,我們打造一個完整的 自動化新聞翻譯工作流:透過 RSS 抓取外國新聞 → DeepL 官方 Node 翻譯 → Discord 推送。這個流程 免費、快速上手,適合個人或團隊追蹤國際新聞。


一、為什麼選擇 DeepL + n8n

  1. 翻譯品質高
    DeepL 對於中英文、日文、德文等語言的翻譯準確度高,適合新聞、文章、技術文件等。

  2. 免費額度可用
    DeepL Free API 每月 50 萬字免費額度,對個人使用或小型專案已足夠。

  3. 官方 Node 支援
    n8n 提供 DeepL Node,直接填入 API Key 與語言即可完成翻譯,不用自己撰寫 HTTP Request。


二、流程架構

整體工作流如下:

  1. RSS Node:抓取外國新聞 RSS Feed
  2. Function Node:整理文章標題與內容
  3. DeepL Node:將文章翻譯成中文
  4. Function Node:整理 DeepL 回傳結果
  5. Discord Node:將翻譯後文章推送到 Discord 頻道

三、環境準備

  1. DeepL API Free

  2. 安裝並啟動 n8n

    npm install -g n8n
    n8n start
    
  3. 建立 Discord Webhook

    • 在 Discord 伺服器設定中建立 Webhook
    • 取得 Webhook URL,用於推送訊息

四、n8n 節點設計

1. RSS Node

  • URL:例如 BBC World News

    http://feeds.bbci.co.uk/news/world/rss.xml
    
  • 抓取頻率:每小時一次或依需求調整
    https://ithelp.ithome.com.tw/upload/images/20250927/20168203ACZR6Ogxgb.png

2. Function Node(整理文章)

return items.map(item => {
  return {
    json: {
      title: item.json.title,
      content: item.json.contentSnippet
    }
  };
});

https://ithelp.ithome.com.tw/upload/images/20250927/20168203eTKTXIK3Yp.png

3. DeepL Node(翻譯)

  • Text={{$json["title"]}} {{$json["content"]}}
  • Source Language:自動或指定 EN
  • Target LanguageChinese (traditional)
  • Credentials:填入你的 DeepL Free API Key

https://ithelp.ithome.com.tw/upload/images/20250927/201682038Sk5XZEFFt.png
https://ithelp.ithome.com.tw/upload/images/20250927/20168203zL2TX7GdZs.png

4. Function Node(整理 DeepL 結果)

return items.map(item => {
  // 取出翻譯文字
  const text = item.json.text || "翻譯失敗";
  return {
    json: {
      message: text
    }
  };
});

https://ithelp.ithome.com.tw/upload/images/20250927/20168203ZeS2tGVscd.png

5. Discord Node

  • Webhook URL:填入 Discord Webhook
  • Message={{$json["message"]}}
    https://ithelp.ithome.com.tw/upload/images/20250927/20168203VYjsz4yXuh.png

完整 Workflow

https://ithelp.ithome.com.tw/upload/images/20250927/20168203hx7vW37qZ0.png

成果

https://ithelp.ithome.com.tw/upload/images/20250927/20168203gMqo88g5n5.png

五、總結

透過 官方 DeepL Node + n8n,我們可以快速打造一個 免費、簡單、可自動化的新聞翻譯流程
完全適合個人學習或團隊追蹤國際新聞。


上一篇
Day12 Gemini AI:自動摘要文章並傳送到 Discord
下一篇
Day14 Gemini 圖像生成串接 Discord
系列文
30 天自動化高手養成:玩轉 n8n 工作流15
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言