8
n8n 中文网amn8n.com

新4K蓝光

中级

这是一个Market Research领域的自动化工作流,包含 12 个节点。主要使用 Code, Html, Discord, HttpRequest, ManualTrigger 等节点。 从Blu-ray.com发送每日4K蓝光预购更新到Discord

前置要求
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "qXu0tfPcXDGpUc78",
  "meta": {
    "instanceId": "2a92e1aed4e75113f119ba031c55ebfbb7ec184402fa742db5b7b5ac94a2d195",
    "templateCredsSetupCompleted": true
  },
  "name": "新 4K 蓝光",
  "tags": [
    {
      "id": "XrTXLWIfdhG5osoz",
      "name": "Discord Bot",
      "createdAt": "2025-07-26T13:00:23.072Z",
      "updatedAt": "2025-07-26T13:00:23.072Z"
    }
  ],
  "nodes": [
    {
      "id": "cd316a5a-80f3-426a-9445-1ef353935606",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -128,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a0904d67-33af-48be-9779-ca3dea0eaf31",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -128,
        16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 23
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a5af30f0-c089-449e-a507-4875bca3fb62",
      "name": "筛选今日项目",
      "type": "n8n-nodes-base.code",
      "position": [
        816,
        -80
      ],
      "parameters": {
        "jsCode": "function isValidDate(str) {\n  const date = new Date(str);\n  return !isNaN(date.getTime());\n}\n\nlet activeDate = \"\";\nlet preOrders = [];\nfor (const item of $input.first().json.links) {\n  if (isValidDate(item)) {\n    activeDate = item;\n  } else {  \n    // if the current activeDate is todays date, grab the item\n    if (activeDate === $('Format Todays Date').first().json.formattedDate) {\n      preOrders.push(item.substring(item.indexOf(\"]\")+1));\n    }\n  }\n}\n\nreturn [\n  {\n    json: {\n      items: preOrders\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "022e701c-0396-4cc7-a2cd-d19ca8674ccc",
      "name": "格式化今日日期",
      "type": "n8n-nodes-base.code",
      "position": [
        144,
        -80
      ],
      "parameters": {
        "jsCode": "const today = new Date();\nconst formatted = today.toLocaleDateString('en-US', {\n  year: 'numeric',\n  month: 'long',\n  day: '2-digit',\n  timeZone: 'America/New_York'\n});\n\nreturn [{ json: { formattedDate: formatted } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "5e895cde-5267-4a75-b591-9ef2878f3336",
      "name": "抓取页面",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        368,
        -80
      ],
      "parameters": {
        "url": "https://www.blu-ray.com/movies/movies.php?show=newpreorders",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "37894741-4b1f-4a83-bd1b-5fb48e223f02",
      "name": "获取超链接",
      "type": "n8n-nodes-base.html",
      "position": [
        592,
        -80
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "links",
              "cssSelector": "td[width=728]>h3, td[width=728]>div div",
              "returnArray": true,
              "returnValue": "html"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4f621c43-bdc5-45c4-b9d4-185c1ae2c7cd",
      "name": "格式化消息",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        -80
      ],
      "parameters": {
        "jsCode": "function extractTitleAndHref(htmlString) {\n  const hrefStart = htmlString.indexOf('href=\"') + 6;\n  const hrefEnd = htmlString.indexOf('\"', hrefStart);\n  const href = htmlString.substring(hrefStart, hrefEnd);\n\n  const titleStart = htmlString.indexOf('title=\"') + 7;\n  const titleEnd = htmlString.indexOf('\"', titleStart);\n  const title = htmlString.substring(titleStart, titleEnd);\n\n  return { title, href };\n}\n\nlet message = \"*New 4k Preorders Today!*\\n\"\n\nfor (const link of $input.first().json.items) {\n  let anchor = extractTitleAndHref(link);\n  \n  message += \"[\" + anchor.title + \"](\" + anchor.href + \")\\n\";\n}\n\nreturn [{json: { message: message }}];"
      },
      "typeVersion": 2
    },
    {
      "id": "4a183f69-e7c8-4dec-9539-c06aa54403b4",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -192
      ],
      "parameters": {
        "color": 3,
        "width": 192,
        "height": 256,
        "content": "### 待办事项:"
      },
      "typeVersion": 1
    },
    {
      "id": "65f6e537-25a4-4172-95b1-f00ce88ba963",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -208
      ],
      "parameters": {
        "color": 3,
        "width": 208,
        "height": 272,
        "content": "### 待办事项:"
      },
      "typeVersion": 1
    },
    {
      "id": "cce9e2db-c782-42e8-be70-2b6fc284526a",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 272,
        "content": "### 可选:"
      },
      "typeVersion": 1
    },
    {
      "id": "608c52a5-f4c8-494f-97d7-6e2781cede4d",
      "name": "发布到 Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1264,
        -80
      ],
      "webhookId": "6ebe5b2a-c28d-48aa-acaa-cc6394d8c3fa",
      "parameters": {
        "content": "={{ $json.message }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "YA7L49Rs3rc4WK12",
          "name": "Discord 4kBlurays"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "4493320f-25af-4e7e-83cd-36e59a46ed49",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        -16
      ],
      "parameters": {
        "width": 192,
        "height": 256,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8c88d280-3fc6-452e-b0d6-b6168c6f6bb2",
  "connections": {
    "Scrape Page": {
      "main": [
        [
          {
            "node": "Get Hyperlinks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Message": {
      "main": [
        [
          {
            "node": "Post to Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Hyperlinks": {
      "main": [
        [
          {
            "node": "Filter Todays Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Format Todays Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Todays Date": {
      "main": [
        [
          {
            "node": "Scrape Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Todays Items": {
      "main": [
        [
          {
            "node": "Format Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Format Todays Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 市场调研

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类1
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Jason Krol

Jason Krol

@shorttompkins

Senior Engineering Manager with over 20 years of professional experience. While I'm not getting paid to code during the day, I still find time at night to mess around and have fun. Lately I've been really enjoying my time spent learning new automation and AI tools!

外部链接
在 n8n.io 查看

分享此工作流