8
n8n 中文网amn8n.com

编程方式获取可嵌入的Getty图片

高级

这是一个Marketing领域的自动化工作流,包含 19 个节点。主要使用 If, Set, Html, HttpRequest, StopAndError 等节点。 编程方式获取可嵌入的Getty图片

前置要求
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "a9f3b18652ddc96459b459de4fa8fa33252fb820a9e5a1593074f3580352864a"
  },
  "nodes": [
    {
      "id": "f4ed726d-21cd-48b3-a4ec-17b57238be44",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        404
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5bf1311a-1180-46ae-9a9e-3e1b20cac4e5",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        900
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a98fd7b8-96dd-42b4-92e0-cf3b2b04bdd0",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        658,
        402
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "af5d60ee-f8cb-4efa-8bac-bc6fdab15fe8",
      "name": "解析结果页面的第一张图片",
      "type": "n8n-nodes-base.html",
      "position": [
        140,
        620
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4365311f-2c04-4cbf-926b-9bd8a4e6dcab",
      "name": "如果存在结果则继续",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        620
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "fdbd15ac-2e38-40ff-9e1e-678e79874b49",
      "name": "从 URL 中提取 Getty image_id",
      "type": "n8n-nodes-base.set",
      "notes": "getty_image_id",
      "position": [
        700,
        720
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "9173f29a-6986-45e4-b4b7-1e8fd9d99e31",
      "name": "获取照片详情",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "3544930a-c623-421b-8815-455d418f8d60",
      "name": "获取 img src",
      "type": "n8n-nodes-base.html",
      "position": [
        900,
        480
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "18067de2-1ee1-4c0e-8fc4-8bd430c4d5bb",
      "name": "获取可嵌入的 iframeSnippet",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        720
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "59e887a1-ba83-4ae3-a0af-95d0aa844b18",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        900
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "eb1bf559-435f-4ed2-af70-813e779ff6c0",
      "name": "请求 Getty Images 嵌入代码",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "https://embed.gettyimages.com/preview/",
      "position": [
        900,
        720
      ],
      "parameters": {},
      "notesInFlow": false,
      "typeVersion": 4.2
    },
    {
      "id": "f9f02bab-6f9a-4dd1-be90-c1e6c1dde662",
      "name": "无结果时抛出错误",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        520,
        800
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8519d771-d78b-4a90-91da-ab5ef3d71720",
      "name": "替换为 CMS 节点",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1320,
        720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "cfa22c39-ad39-4324-8fe6-f24bdb78824f",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        820
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "38050f94-c884-4bcb-b55a-ce12cb9628c2",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        658,
        673
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dff414b9-3945-406d-a247-76fa4d90e327",
      "name": "Getty Images 编辑搜索",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -60,
        620
      ],
      "parameters": {},
      "notesInFlow": false,
      "typeVersion": 4.2
    },
    {
      "id": "df05b448-4901-4713-99fb-2923970f8703",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -460,
        620
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "94c6fc16-a97d-4e1e-932c-2c5009a9e474",
      "name": "可替换输入",
      "type": "n8n-nodes-base.set",
      "position": [
        -260,
        620
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "2e146f9e-cb67-457d-844e-e958cff8d8ae",
      "name": "预览图像(查看二进制)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "GET img src": {
      "main": [
        [
          {
            "node": "Preview image (view binary)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get photo details": {
      "main": [
        [
          {
            "node": "GET img src",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replaceable input": {
      "main": [
        [
          {
            "node": "Getty Images Editorial Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Continue if a result exists": {
      "main": [
        [
          {
            "node": "Extract the Getty image_id from url",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get photo details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Raise error when no results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Embeddable iframeSnippet": {
      "main": [
        [
          {
            "node": "Replace with CMS node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Getty Images Editorial Search": {
      "main": [
        [
          {
            "node": "Parse results page for first image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Getty Images Embed code": {
      "main": [
        [
          {
            "node": "Get Embeddable iframeSnippet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Replaceable input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse results page for first image": {
      "main": [
        [
          {
            "node": "Continue if a result exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the Getty image_id from url": {
      "main": [
        [
          {
            "node": "Request Getty Images Embed code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 营销

需要付费吗?

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

工作流信息
难度等级
高级
节点数量19
分类1
节点类型8
难度说明

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

作者
Ludwig

Ludwig

@ludwig

If you have any questions about any of the templates I've built, please reach out to me on LinkedIn (https://www.linkedin.com/in/ludwiggerdes) or via my website down below. 👇

外部链接
在 n8n.io 查看

分享此工作流