{
  "id": "Gen31",
  "name": "\u628a Google \u65b0\u805e\u6574\u7406\u6210\u4e00\u7bc7\u6587\u7ae0",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "id": "n-sched",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        460
      ]
    },
    {
      "parameters": {
        "url": "https://news.google.com/rss/search?q=AI&hl=zh-TW&gl=TW&ceid=TW:zh-Hant",
        "options": {}
      },
      "id": "n-rss0",
      "name": "RSS 1",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        460,
        280
      ]
    },
    {
      "parameters": {
        "jsCode": "const seen=new Set();const items=[];\nfor (const it of $input.all()){const j=it.json;const t=(j.title||'').trim();const l=j.link||j.url||'';if(!t||seen.has(t))continue;seen.add(t);items.push({t,l});if(items.length>=15)break;}\nconst list=items.map((n,i)=>(i+1)+'. '+n.t).join('\\n');\nconst prompt='\u4f60\u662f\u7de8\u8f2f\u3002\u628a\u4ee5\u4e0b\u65b0\u805e\u6a19\u984c\u5f59\u6574\u6210\u4e00\u7bc7 300 \u5b57\u7e41\u9ad4\u4e2d\u6587\u77ed\u6587\uff08\u542b\u5c0f\u6a19\uff09\uff1a\\n\\n'+list;\nreturn [{json:{count:items.length,prompt}}];"
      },
      "id": "n-prep",
      "name": "Prepare",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        460
      ]
    },
    {
      "parameters": {
        "options": {
          "timeout": 180000
        },
        "method": "POST",
        "url": "http://host.docker.internal:11434/api/chat",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: 'qwen2.5:latest', messages: [ { role: 'system', content: '\u4f60\u662f\u53f0\u7063\u4eba\uff0c\u4e00\u5f8b\u4f7f\u7528\u53f0\u7063\u7e41\u9ad4\u4e2d\u6587\u8207\u53f0\u7063\u6163\u7528\u8a9e\u56de\u8986\uff0c\u7d55\u5c0d\u4e0d\u8981\u51fa\u73fe\u4efb\u4f55\u7c21\u9ad4\u5b57\u6216\u4e2d\u570b\u7528\u8a9e\u3002' }, { role: 'user', content: $json.prompt } ], stream: false }) }}"
      },
      "id": "n-ollama",
      "name": "Summarize with Ollama",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        460
      ]
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json;\nlet v = '';\ntry { v = (data.message && data.message.content) || (data.content && data.content[0] && data.content[0].text) || data.response || ''; } catch (e) {}\nif (!v) v = JSON.stringify(data);\nreturn [{ json: { summary: v } }];"
      },
      "id": "n-extract",
      "name": "Extract Result",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1340,
        460
      ]
    },
    {
      "parameters": {
        "options": {},
        "method": "POST",
        "url": "https://discord.com/api/webhooks/REPLACE_WITH_YOUR_WEBHOOK_URL",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ content: ('\ud83d\udcf0 \u628a Google \u65b0\u805e\u6574\u7406\u6210\u4e00\u7bc7\u6587\u7ae0\\n\\n' + ($json.summary || '')).slice(0, 1900) }) }}"
      },
      "id": "n-discord",
      "name": "Send to Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1560,
        460
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "RSS 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS 1": {
      "main": [
        [
          {
            "node": "Prepare",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare": {
      "main": [
        [
          {
            "node": "Summarize with Ollama",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize with Ollama": {
      "main": [
        [
          {
            "node": "Extract Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Result": {
      "main": [
        [
          {
            "node": "Send to Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": []
}