8
n8n 中文网amn8n.com

新抓取器_TechCrunch新闻-AI1

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 18 个节点。主要使用 Set, Code, Html, Wait, Switch 等节点。 TechCrunch AI文章抓取与分类器,使用GPT-4.1-nano到Sheets和Telegram

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "IXx6s3iehIS02UoN",
  "meta": {
    "instanceId": "4b2d3266990bb4e66d2cfaf675d25abf91c20640453791e42ee70c94a15f5b61",
    "templateCredsSetupCompleted": true
  },
  "name": "NewScraper_TechCrunchNews-AI1",
  "tags": [],
  "nodes": [
    {
      "id": "aa1269ef-413b-4ad5-97b3-77e14ab9176f",
      "name": "计划触发器1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        220
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ffcf7806-034e-4a35-81c7-d3b62859f19c",
      "name": "GetDate1",
      "type": "n8n-nodes-base.html",
      "position": [
        540,
        220
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "DatePublished",
              "attribute": "datetime",
              "cssSelector": ".loop-card__meta > time",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "url",
              "attribute": "data-destinationlink",
              "cssSelector": ".loop-card__title > a",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "430c086c-c7ce-438b-b940-90fd7a2e0497",
      "name": "Split URL3",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        800,
        220
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "DatePublished, url"
      },
      "typeVersion": 1
    },
    {
      "id": "fb856de2-b883-4ff4-a54e-afc1567603a8",
      "name": "Edit Fields6",
      "type": "n8n-nodes-base.set",
      "position": [
        1020,
        220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a058f371-80be-4b4b-a275-f453cd061664",
              "name": "DatePublished",
              "type": "string",
              "value": "={{ $json.DatePublished.toDateTime().format('dd/MM/yyyy') }}"
            },
            {
              "id": "042a5c23-a1e8-425b-81eb-20e406caf4d3",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c6092ee7-e625-45b1-b12c-e72e7d8f1190",
      "name": "TechCrunchNews-AI1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        220
      ],
      "parameters": {
        "url": "https://techcrunch.com/category/artificial-intelligence/",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "9e6e2d2f-c3a2-4e64-b33b-3630237bb1c3",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        140
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 240,
        "content": "## 新闻来自美国"
      },
      "typeVersion": 1
    },
    {
      "id": "a1252e73-7c37-463f-86c9-3f58a70459ea",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        100,
        500
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b9749e79-02bb-431a-878b-c89d175303fb",
      "name": "TimeWaitRandom1",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        620
      ],
      "parameters": {
        "jsCode": "const minDelay = 4; // 4 seconds\nconst maxDelay = 10; // 10 seconds\nconst randomDelay = Math.floor(Math.random() * (maxDelay - minDelay + 1)) + minDelay;\nreturn [{ json: { delay: randomDelay } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "b3d14c0e-fe0a-46b6-b618-00007898dbb9",
      "name": "AI 代理1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1100,
        620
      ],
      "parameters": {
        "text": "=คุณคือนักรายงานข่าวอัจฉริยะที่สามารถสรุป วิเคราะห์ จัดหมวดหมู่ข่าวได้อย่างมีวิจารณญาณ และใช้ภาษาไทยที่เข้าใจง่าย \n\nโปรดทำ 3 สิ่งต่อไปนี้จากบทความข่าวด้านล่าง:\n\n1. **สรุปข่าว**  \nสรุปเนื้อหาให้ชัดเจน กระชับ ดึงดูด ภายใน 3–4 ประโยค\n\n2. **ให้คะแนนข่าว (1–100)**  \nประเมินข่าวอย่างเข้มงวด โดยไม่อิงจากหมวดหมู่ แต่เน้นคุณภาพข่าวตามเกณฑ์ต่อไปนี้:\n\n- **ความสำคัญและผลกระทบ (สูงสุด 30 คะแนน)**  \n  - ข่าวที่มีผลกระทบต่อประชาชน หรือมีผลเชิงนโยบายระยะยาว  \n- **สาระและเนื้อหาใหม่ (สูงสุด 25 คะแนน)**  \n  - ข่าวที่ให้ข้อมูลใหม่ เปิดมุมมอง หรือเชื่อมโยงบริบทที่ลึก  \n- **คุณภาพการรายงาน (สูงสุด 25 คะแนน)**  \n  - เขียนชัดเจน อ้างอิงได้ มีโครงสร้างดี ไม่ใช่แค่เล่าข่าว  \n- **ความน่าสนใจของการนำเสนอ (สูงสุด 20 คะแนน)**  \n  - เล่าได้ดึงดูด มีรายละเอียด หรือเชื่อมโยงกับปัจจุบัน\n\n**ตัดคะแนนทันที** หากพบว่า:\n- ข่าวโฆษณา/ประชาสัมพันธ์ (-20 ถึง -30)\n- ข่าวที่ไม่มีเนื้อหาใหม่ ซ้ำซาก (-10 ถึง -20)\n- ข่าวไร้แหล่งอ้างอิงหรือใช้ภาษาคลุมเครือ (-10)\n\n3. **จัดหมวดหมู่ข่าว**  \nเลือก **เพียง 1 หมวด** จากรายการต่อไปนี้เท่านั้น หากบทความไม่ตรงกับหมวดใดเลย ให้เลือกหมวดที่ \"ใกล้เคียงที่สุด\" แต่ห้ามสร้างหัวข้อใหม่:\n- การเมือง\n- เศรษฐกิจ\n- สังคม\n- บันเทิง\n- กีฬา\n- เทคโนโลยี\n- โลก\n- สิ่งแวดล้อม\n- ไลฟ์สไตล์\n\n---\nเนื้อหาข่าว:\n{{ $json.body }}\n\nกรุณาตอบในรูปแบบ JSON ที่มี key:\n{\n  \"headline\": \"หัวข้อ\"\n  \"summary\": \"ข้อความสรุป...\" \n  \"score\": \"75\"\n  \"category\": \"การเมือง\"\n}\n\n\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "2c86dbf3-3027-44b6-8772-4488f56a31df",
      "name": "结构化输出解析器 1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1300,
        840
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"headline\": \"หัวข้อ\",\n  \"summary\": \"ข้อความสรุป...\" ,\n  \"score\": \"75\",\n  \"category\": \"การเมือง\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "65d4a028-6f4d-42d2-b24b-728784f3ec8b",
      "name": "等待1",
      "type": "n8n-nodes-base.wait",
      "position": [
        540,
        620
      ],
      "webhookId": "77f708eb-1077-47ff-97f1-64b395e6a44d",
      "parameters": {
        "amount": "={{ $json.delay.format() }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "6fba93e0-2a5f-41c9-9955-61cdbc330e9a",
      "name": "SelectDate",
      "type": "n8n-nodes-base.switch",
      "position": [
        1260,
        220
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "YesterdayOnly",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fa0fc720-5e18-4c64-b799-beba5832b2f2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.DatePublished }}",
                    "rightValue": "={{ $now.minus(1,'days').format('dd/MM/yyyy') }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "OtherDate",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "51c43c73-59be-43da-893b-0d82600e735e",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "",
                    "rightValue": "="
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {},
        "looseTypeValidation": true
      },
      "typeVersion": 3.2
    },
    {
      "id": "51539126-b570-4edd-8760-874e87a20a88",
      "name": "设置数据",
      "type": "n8n-nodes-base.set",
      "position": [
        380,
        420
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0be8d0c0-55c7-4bcb-8d33-6201a0dbca15",
              "name": "score",
              "type": "number",
              "value": "={{ $json.output.score }}"
            },
            {
              "id": "5e1e4b20-9846-4d95-aea5-76695177cf19",
              "name": "headline",
              "type": "string",
              "value": "={{ $json.output.headline }}"
            },
            {
              "id": "14a4eba5-ee9d-4bd3-9e78-19acdd4a9ec9",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.output.summary }}"
            },
            {
              "id": "0952111c-4c09-4808-a6bc-a3d5a72e5498",
              "name": "category",
              "type": "string",
              "value": "={{ $json.output.category }}"
            },
            {
              "id": "f405e7a5-a470-448a-9a86-69f77577d444",
              "name": "url",
              "type": "string",
              "value": "={{ $('SelectDate').item.json.url }}"
            },
            {
              "id": "fe74ca8b-84d8-4180-a536-d0a606c66439",
              "name": "DatePublished",
              "type": "string",
              "value": "={{ $('SelectDate').item.json.DatePublished }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bd31c5a9-04d4-476d-97d7-ff26630e1a89",
      "name": "URL_Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        620
      ],
      "parameters": {
        "url": "={{ $('SelectDate').item.json.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "ec9f6b15-5e64-4958-9b75-01760144a190",
      "name": "GetBody",
      "type": "n8n-nodes-base.html",
      "position": [
        920,
        620
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "body",
              "cssSelector": "div[class*=\"entry-content\"]",
              "returnArray": true
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ad427981-d239-4df7-a271-e470173f3ee4",
      "name": "NewsData",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        620,
        420
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "score": "={{ $json.score }}",
            "summary": "={{ $json.summary }}",
            "category": "={{ $json.category }}",
            "headline": "={{ $json.headline }}",
            "DatePublished": "={{ $json.DatePublished }}"
          },
          "schema": [
            {
              "id": "score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "headline",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "category",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DatePublished",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "DatePublished",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TcYe0JRUh_boWjpo7BLAB_9ylyEQV_GZK8CAEb73yWs/edit#gid=0",
          "cachedResultName": "ชีต1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1TcYe0JRUh_boWjpo7BLAB_9ylyEQV_GZK8CAEb73yWs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TcYe0JRUh_boWjpo7BLAB_9ylyEQV_GZK8CAEb73yWs/edit?usp=drivesdk",
          "cachedResultName": "NewScraper_TechCrunchNews-AI1"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "IpXPOfpFVgHmiHxo",
          "name": "Google Sheets account myhit"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.6
    },
    {
      "id": "c049aaca-1bdd-4a68-a134-682e64a66b5f",
      "name": "Gpt-4.1-nano",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1080,
        840
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "lpWCJ9hKwHqCc7QI",
          "name": "OpenAi account  VPS n8n VDO"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9ac379e6-b52f-439e-8782-628ea4fc5851",
      "name": "发送短信",
      "type": "n8n-nodes-base.telegram",
      "position": [
        840,
        420
      ],
      "webhookId": "b1932bf7-dde1-4040-9aea-d0d6ec06205b",
      "parameters": {
        "text": "=สรุปข่าวใหม่ 📰 วันที่: {{$json.DatePublished}}\n\nหัวข้อ📣 : {{$json.headline}}\n\nสรุป💬 : {{$json.summary}}\n\nคะแนน⭐ : {{$json.score}}\nหมวดหมู่📁 : {{$json.category}}\nลิงก์🔗 : {{$json.url}}",
        "chatId": "8163566489",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "wQDSREqjdwEhB9xt",
          "name": "Telegram NEWs"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "timezone": "Asia/Bangkok",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "sc4tWKBqR14k7z2b",
    "executionOrder": "v1"
  },
  "versionId": "f32176d3-f07f-4135-87d1-27994f693fc7",
  "connections": {
    "Wait1": {
      "main": [
        [
          {
            "node": "URL_Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetBody": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SetData": {
      "main": [
        [
          {
            "node": "NewsData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetDate1": {
      "main": [
        [
          {
            "node": "Split URL3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NewsData": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SelectDate": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split URL3": {
      "main": [
        [
          {
            "node": "Edit Fields6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "URL_Content": {
      "main": [
        [
          {
            "node": "GetBody",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields6": {
      "main": [
        [
          {
            "node": "SelectDate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gpt-4.1-nano": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "TimeWaitRandom1": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "SetData",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "TimeWaitRandom1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "TechCrunchNews-AI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TechCrunchNews-AI1": {
      "main": [
        [
          {
            "node": "GetDate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 市场调研, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量18
分类2
节点类型15
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流