8
n8n 中文网amn8n.com

使用ChannelCrawler和GPT在Google Slides中创建YouTube频道资料报告

中级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 15 个节点。主要使用 Code, FormTrigger, HttpRequest, GoogleSlides, SplitInBatches 等节点。 使用ChannelCrawler和GPT-4在Google Slides中生成YouTube频道资料报告

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "XvIOD0Q9wc7392w9",
  "meta": {
    "instanceId": "a01833781c2355cf72c14f621544f956f9bdfe31ca9d6f99e674faa4514926e8"
  },
  "name": "使用 ChannelCrawler 和 GPT 在 Google Slides 中创建 YouTube 频道资料报告",
  "tags": [],
  "nodes": [
    {
      "id": "533d9323-5756-43aa-8008-fff04ca902e7",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        592,
        208
      ],
      "webhookId": "d440b07c-587f-49ee-90a3-f5b2de63cb9d",
      "parameters": {
        "options": {},
        "formTitle": "Youtube Persona Slide Creator",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Youtube URLs"
            }
          ]
        },
        "formDescription": "Add the URL of the YouTube channel"
      },
      "typeVersion": 2.3
    },
    {
      "id": "ecc50703-7a5d-4db8-b456-b50ce77d3d3d",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1088,
        208
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b379cb14-d584-4caa-87d9-3027330142d3",
      "name": "Channel Crawler",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        224
      ],
      "parameters": {
        "url": "https://api.channelcrawler.com/v1/priority/channel",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"channel\": \"{{ $json.url }}\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "httpBearerAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "46318dc5-814d-4c75-b863-332e26296996",
      "name": "清理表单提交",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        208
      ],
      "parameters": {
        "language": "python",
        "pythonCode": "input_data = items[0]['json']\n\n# Extract the influencers string from the \"Add list of infuencers\" field\ninfluencers_string = input_data.get(\"Youtube URLs\", \"\")\n\n# Split by \\r\\n and clean up each URL (remove extra whitespace)\nurl_list = [url.strip() for url in influencers_string.split('\\r\\n') if url.strip()]\n\n# Convert to the desired format\nresult = [{\"url\": url} for url in url_list]\n\n# Return the result as n8n expects it\nreturn result"
      },
      "typeVersion": 2
    },
    {
      "id": "771f78ff-926c-4574-a850-88682f3dc618",
      "name": "为资料添加标题",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1520,
        224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Looking at the description. Come up with a brief title for this creator for my marketing presentation. {{ $json.json.result.core.description }}"
            }
          ]
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "4b5e9a1a-76ed-4ce6-a53e-2badeec9c7a7",
      "name": "资料摘要",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1824,
        224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Give a Summary of the following profile in a few sentences (max 4) using the provided context.\nAlways start with their name, Focus on their industry,expertise and what they talk about:\ncontext 1:{{ $('Channel Crawler').item.json.json.result.core.description }}\ncontext 2:{{ $('Channel Crawler').item.json.json.result.classification.keywords }}"
            }
          ]
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "7545b969-5e6e-49d7-949b-e07e37ae6f2c",
      "name": "获取演示文稿",
      "type": "n8n-nodes-base.googleSlides",
      "position": [
        2128,
        224
      ],
      "parameters": {
        "resource": "page",
        "pageObjectId": "p"
      },
      "typeVersion": 2
    },
    {
      "id": "6100dd80-e4a1-429b-b5eb-592c606e8d51",
      "name": "创建新页面",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2304,
        224
      ],
      "parameters": {
        "url": "https://slides.googleapis.com/v1/presentations/{insert_Presentation_ID}:batchUpdate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"requests\": [\n    {\n      \"duplicateObject\": {\n        \"objectId\": \"{{ $json.objectId }}\"\n      }\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleSlidesOAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "00304c0c-8e39-44f3-a157-722f5afc6f08",
      "name": "获取新页面",
      "type": "n8n-nodes-base.googleSlides",
      "position": [
        2480,
        224
      ],
      "parameters": {
        "resource": "page",
        "pageObjectId": "p",
        "presentationId": "={{ $json.presentationId }}"
      },
      "typeVersion": 2
    },
    {
      "id": "417f8fb2-1d9d-406d-bc41-40e00b4f531b",
      "name": "替换资料图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2688,
        224
      ],
      "parameters": {
        "url": "https://slides.googleapis.com/v1/presentations/{insert_Presentation_ID}:batchUpdate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"requests\": [\n        {\n            \"replaceImage\": {\n                \"imageObjectId\": \"{{ $json.pageElements[3].objectId }}\",\n                \"url\": \"{{ $('Channel Crawler').item.json.json.result.profile.avatar }}\",\n                \"imageReplaceMethod\": \"CENTER_CROP\"\n            }\n        }\n    ],\n    \"writeControl\": {\n        \"requiredRevisionId\": \"{{ $json.revisionId }}\"\n    }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleSlidesOAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "d934cd46-7876-426a-95de-188c1e3d8231",
      "name": "替换页面中的文本",
      "type": "n8n-nodes-base.googleSlides",
      "onError": "continueRegularOutput",
      "position": [
        2688,
        672
      ],
      "parameters": {
        "textUi": {
          "textValues": [
            {
              "text": "={{ $('Get a new page').item.json.pageElements[5].shape.text.textElements[1].textRun.content }}",
              "replaceText": "={{ $('Channel Crawler').item.json.json.result.core.title }}",
              "pageObjectIds": [
                "p"
              ]
            },
            {
              "text": "={{ $('Get a new page').item.json.pageElements[7].shape.text.textElements[1].textRun.content }}",
              "replaceText": "={{ $('Channel Crawler').item.json.json.result.classification.country.name }}",
              "pageObjectIds": [
                "p"
              ]
            },
            {
              "text": "={{ $('Get a new page').item.json.pageElements[8].shape.text.textElements[1].textRun.content }}",
              "replaceText": "=Youtube Subscribers: {{ $('Channel Crawler').item.json.json.result.core.subscribers }}",
              "pageObjectIds": [
                "p"
              ]
            },
            {
              "text": "={{ $('Get a new page').item.json.pageElements[6].shape.text.textElements[1].textRun.content }}",
              "replaceText": "={{ $('Profile Summary').item.json.message.content }}",
              "pageObjectIds": [
                "p"
              ]
            },
            {
              "text": "={{ $('Get a new page').item.json.pageElements[9].shape.text.textElements[1].textRun.content }}",
              "replaceText": "={{ $('Channel Crawler').item.json.json.result.external.links[0].url }}\n{{ $('Channel Crawler').item.json.json.result.external.links[1].url }}\n{{ $('Channel Crawler').item.json.json.result.external.links[2].url }}\n{{ $('Channel Crawler').item.json.json.result.external.links[4].url }}",
              "pageObjectIds": [
                "p"
              ]
            },
            {
              "text": "={{ $('Get a new page').item.json.pageElements[4].shape.text.textElements[1].textRun.content }}",
              "replaceText": "={{ $('Title the profile').item.json.message.content }}",
              "pageObjectIds": [
                "p"
              ]
            }
          ]
        },
        "options": {},
        "operation": "replaceText"
      },
      "typeVersion": 2
    },
    {
      "id": "7d4c102a-4307-4243-8e4f-0355fcce4751",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -96
      ],
      "parameters": {
        "width": 640,
        "height": 896,
        "content": "## ChannelCrawler API 到 Google Slides 模板"
      },
      "typeVersion": 1
    },
    {
      "id": "f4bf7a27-ae76-4e82-95bf-7322677c2b8a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 320,
        "content": "## AI 标题生成与摘要"
      },
      "typeVersion": 1
    },
    {
      "id": "4ed49427-8832-42b2-835d-654ea10b6647",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 368,
        "content": "## Google 演示文稿获取与复制"
      },
      "typeVersion": 1
    },
    {
      "id": "c759c6e5-27c5-4106-a4f0-72581293143b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        400
      ],
      "parameters": {
        "color": 4,
        "width": 544,
        "height": 304,
        "content": "## 示例 API 响应"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "74bcb6b3-4322-4a3e-b508-dc51b44e48bd",
  "connections": {
    "Get a new page": {
      "main": [
        [
          {
            "node": "Replace Profile image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Channel Crawler": {
      "main": [
        [
          {
            "node": "Title the profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Channel Crawler",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Profile Summary": {
      "main": [
        [
          {
            "node": "Get Presentation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Presentation": {
      "main": [
        [
          {
            "node": "Create a new page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a new page": {
      "main": [
        [
          {
            "node": "Get a new page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Title the profile": {
      "main": [
        [
          {
            "node": "Profile Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Clean Form Submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace text in Page": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Form Submission": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace Profile image": {
      "main": [
        [
          {
            "node": "Replace text in Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
外部链接
在 n8n.io 查看

分享此工作流