iT邦幫忙

2025 iThome 鐵人賽

DAY 4
0
生成式 AI

30 天效率革命:用 n8n + AI 打造專屬助手系列 第 4

Day 4 : 每天收到最新 AI 論文摘要(01):n8n + arXiv API

  • 分享至 

  • xImage
  •  

建立第一個 Workflow:定時排程 + arXiv API

在熟悉 n8n 的介面與基本概念後,今天我們來實作第一個完整的 Workflow。
這個流程的目標是:每天定時從 arXiv 抓取一篇最新論文,並將標題與摘要發送到 Email。


流程設計目標

  • Trigger:使用 Cron 定時排程,每天早上固定時間啟動
  • Action:透過 HTTP Request 連線到 arXiv API,取得論文資訊
  • Output:將取得的論文標題與摘要輸出(先簡單選擇 Console 或 Email,之後可擴展到 Discord / Notion)

1. 建立新 Workflow

  • 點選 + New Workflow

https://ithelp.ithome.com.tw/upload/images/20250918/20148979jd5wMyc56P.png

2. 新增 Trigger 節點(Schedule Trigger)

  • 設定為每分鐘觸發一次方便驗證

https://ithelp.ithome.com.tw/upload/images/20250918/20148979aLD0sLsgkG.png
https://ithelp.ithome.com.tw/upload/images/20250918/20148979eTiIxOSpgR.png

3. 新增 HTTP Request 節點

  • Method:GET
  • 網址:https://example.com/
  • 設定完之後點 Execute step 測試是否可以取得資料
    https://ithelp.ithome.com.tw/upload/images/20250918/20148979YovxJcTF8s.png
    成功!

然後來測試arxiv的API

  • URL 範例:
    http://export.arxiv.org/api/query?search_query=cat:cs&start=0&max_results=1&sortBy=submittedDate&sortOrder=descending

cat:cs.AI 可指定人工智慧子領域;max_results=1 僅取一篇;sortBy=submittedDate 依提交日期排序。

搜尋tag title 可以發現 arxiv 回傳了一篇2025-09-17最新發布的論文:Apertus: Democratizing Open and Compliant LLMs for Global Language\n Environments
https://ithelp.ithome.com.tw/upload/images/20250918/20148979I5usHFZSkQ.png

4. 解析 API 回傳資料

arXiv 會回傳 XML 格式的資料,我們透過 XML → JSON 節點,將資料轉換為 JSON 方便我們取得 title 與 summary 欄位

https://ithelp.ithome.com.tw/upload/images/20250918/20148979qnlPuswRmb.png

5. 輸出結果(寄出 Email)

用 Gmail Send 節點把標題與摘要寄出
google cloud取建立專案,取得API憑證,包含了google sheet、google日歷 、gemini 等等的API都會在這邊來管理

https://ithelp.ithome.com.tw/upload/images/20250918/2014897970jXOkAswF.png
接下來我是參考geekaz大大的文章n8n 串接憑證教學:
照著內文一步步完成就可以申請到API憑證了

用寄送節點,左側可以拖拉要傳送的元素
https://ithelp.ithome.com.tw/upload/images/20250918/20148979yFDyFcdMiR.png

測試成功!
https://ithelp.ithome.com.tw/upload/images/20250918/20148979OgE5hbiOC4.png

完整流程如下:

https://ithelp.ithome.com.tw/upload/images/20250918/201489791Vx5SAnTDM.png
接下來設定寄信的頻率然後點Active 就可以啟動啦

補充:Arxiv指定關鍵字搜尋

基本格式

https://export.arxiv.org/api/query?search_query=all:{關鍵字}&start=0&max_results=1&sortBy=submittedDate&sortOrder=descending

範例 1:搜尋 "LLM"

https://export.arxiv.org/api/query?search_query=all:LLM&start=0&max_results=1&sortBy=submittedDate&sortOrder=descending

範例 2:多關鍵字(AND)

https://export.arxiv.org/api/query?search_query=all:AI+AND+all:robot&start=0&max_results=1

範例 3:限定領域 + 關鍵字

https://export.arxiv.org/api/query?search_query=cat:cs.AI+AND+all:LLM&start=0&max_results=1

小結

今天完成了一個可用的自動化流程:定時→抓取→解析→寄送。
在明天的章節會介紹如何把結果串接 Gemini,將內文轉為結構化的筆記並寄出。


上一篇
Day 3 : 認識 n8n 介面:Workflow、Node、Trigger
下一篇
Day 5 : 每天收到最新 AI 論文摘要 (02):gemini API
系列文
30 天效率革命:用 n8n + AI 打造專屬助手9
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言