N
n8n Store
Workflow Market
Social Media Trends for creators page

Social Media Trends for creators page

by plemeo0 views

説明

Categories

📢 Marketing🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.setn8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.mergen8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.httpRequestn8n-nodes-base.httpRequest
Price無料
Views0
最終更新11/28/2025
workflow.json
{
  "id": "WEsO2dwjCaN6NwQT",
  "meta": {
    "instanceId": "2cf742429c2e3ee4e5a20069d3d8a75208519303b864f026a79464efa726bd95",
    "templateCredsSetupCompleted": true
  },
  "name": "Social Media Trends for creators page",
  "tags": [
    {
      "id": "wpMIpESnBZpdPCpj",
      "name": "Marketing",
      "createdAt": "2025-06-03T11:38:37.020Z",
      "updatedAt": "2025-06-03T11:38:37.020Z"
    }
  ],
  "nodes": [
    {
      "id": "a4dd01b9-57d6-41ff-9630-1bc6276f48da",
      "name": "Reddit API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -336,
        48
      ],
      "parameters": {
        "url": "https://oauth.reddit.com/r/artificial/hot",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "redditOAuth2Api"
      },
      "credentials": {
        "redditOAuth2Api": {
          "id": "QfwNxnbWZe2Y5RSa",
          "name": "Reddit account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "fd03075f-7e22-48a8-b92a-ef397a7d74e6",
      "name": "Merge Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -96,
        192
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "b5dd36d6-a175-4695-8a02-0e92237bc0d3",
      "name": "Aggregate Content",
      "type": "n8n-nodes-base.code",
      "position": [
        80,
        192
      ],
      "parameters": {
        "jsCode": "const allData = $input.all();\nlet content = '\\n';\n\nallData.forEach(item => {\n  if (item.json.data?.children) {\n    // Reddit data\n    item.json.data.children.slice(0,3).forEach((post, i) => {\n      content += `${i+1}. ${post.data.title}\\n`;\n    });\n  }\n  content += '\\n';\n});\n\n// Output in `aggregatedContent`\nreturn [{\n  json: {\n    aggregatedContent: content,\n    output: $('Get Twitter Trends').first().json.output\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "aa228c26-feb4-4d9e-9535-2da2b4aa3635",
      "name": "Prepare Excel",
      "type": "n8n-nodes-base.code",
      "position": [
        608,
        192
      ],
      "parameters": {
        "jsCode": "const aiResponse = $input.first().json.output;\nconst dateToday = $('Set Config').first().json.dateToday;\n\nlet trendsData;\ntry {\n  const jsonMatch = aiResponse.match(/\\{[\\s\\S]*\\}/);\n  trendsData = jsonMatch ? JSON.parse(jsonMatch[0]) : { trends: [] };\n} catch {\n  trendsData = {\n    trends: [{\n      rank: 1,\n      trend: 'AI Innovation',\n      description: 'AI continues to innovate',\n      platforms: ['Multiple']\n    }]\n  };\n}\n\n// Return one item per row\nreturn trendsData.trends.map(trend => ({\n  json: {\n    Rank: trend.rank,\n    Trend: trend.trend,\n    Description: trend.description,\n    Platforms: Array.isArray(trend.platforms) ? trend.platforms.join(', ') : trend.platforms,\n    Date: dateToday\n  }\n}));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ada69f9a-3b99-4c41-98df-9fed26498184",
      "name": "Create Excel",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        832,
        192
      ],
      "parameters": {
        "options": {},
        "operation": "toFile"
      },
      "typeVersion": 2
    },
    {
      "id": "f6df2ff4-fd06-4073-bc41-a71d2c614010",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        288,
        -16
      ],
      "parameters": {
        "text": "=Analyze these social media trends and extract the top 5 trends in JSON format:\n\nTRENDS FROM REDDIT:\n{{$json.aggregatedContent}}\n\nTRENDS FROM X:\n{{ $json.output }}\n\nRespond with:\n{\n  \"trends\": [\n    {\"rank\": 1, \"trend\": \"Trend Name\", \"description\": \"Description\", \"platforms\": [\"Platform1\"]}\n  ]\n}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "9fc152ce-46e6-45c2-8d3f-72a9e34f5b3a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        288,
        192
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "302e51be-be21-4883-b62a-21c8fc6c4ca4",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -768,
        192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c625cc58-a4aa-4090-9b31-53c92fda8d37",
      "name": "Microsoft SharePoint",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        1040,
        192
      ],
      "parameters": {
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAZCILJ3WHMIXBGZA2UP2JMQ5CXO",
          "cachedResultName": "Newsletter Workflow"
        },
        "fileName": "social-media-trends.xls",
        "operation": "upload",
        "fileContents": "data",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fd72d6de-d25d-4bb1-922b-8a4f0d3d7bca",
      "name": "Get Twitter Trends",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -336,
        320
      ],
      "parameters": {
        "url": "=<YOUR_SERVICE_URL>",
        "method": "POST",
        "options": {
          "allowUnauthorizedCerts": true
        },
        "jsonBody": "={\n  \"workflow_to_run\": \"python <PATH_TO_YOUR_SCRIPT>\\\\\\\\twitter_bot_dynamic.py --topic \\\"{{ $json.topic }}\\\"\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "71e4af0b-959f-48ee-9554-73d08a13abc2",
      "name": "Set Config",
      "type": "n8n-nodes-base.set",
      "position": [
        -560,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9b3e9f6d-6ddb-4871-b4e0-d135d5f82189",
              "name": "dateToday",
              "type": "string",
              "value": "={{ $now.setLocale('en').toFormat('yyyy-MM-dd') }}"
            },
            {
              "id": "308da6fe-c718-4e5e-a309-c276bdfc6658",
              "name": "topic",
              "type": "string",
              "value": "Artificial Intelligence"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5915a721-4aca-4f8f-892e-df152dc2b9a0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -208
      ],
      "parameters": {
        "width": 432,
        "height": 304,
        "content": "### Data Sources Branch  \n**What it does**  \n• Calls Reddit “hot” endpoint for the chosen subreddit.  \n• Calls a custom Twitter (X) trends endpoint.  \n• You can insert additional HTTP/API nodes (YouTube, TikTok, etc.) before **Merge Data**.\n\n**Credentials needed**  \n• Reddit OAuth2  \n• Any keys/tokens for extra APIs you add\n\n**User tweaks**  \n• Change the subreddit in **Reddit API** (e.g., `/r/tech/hot`).  \n• Replace or extend the Twitter-trends HTTP node.  \n• Add more sources and connect them to **Merge Data**."
      },
      "typeVersion": 1
    },
    {
      "id": "e7497dd8-57ed-4ffd-94a3-f04bb18da3c4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -336
      ],
      "parameters": {
        "width": 560,
        "height": 272,
        "content": "### AI Analysis Branch  \n**What it does**  \n• **Aggregate Content** concatenates raw titles.  \n• **AI Agent** (GPT-4o) ranks them and returns the top trends as JSON.\n\n**Credentials needed**  \n• OpenAI API key (GPT-4o or higher)\n\n**User tweaks**  \n• Edit the prompt in **AI Agent** to change ranking logic, number of trends, or output schema.  \n• Adjust the slice/limit logic in **Aggregate Content** to analyze more or fewer posts."
      },
      "typeVersion": 1
    },
    {
      "id": "0101f056-16c6-41ba-a9cc-c5778d3ca64d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -112
      ],
      "parameters": {
        "width": 416,
        "height": 256,
        "content": "### Spreadsheet Creation Branch  \n**What it does**  \n• **Prepare Excel** maps each trend to rows.  \n• **Create Excel** converts rows into an `.xlsx` file.\n\n**Credentials needed**  \nNone\n\n**User tweaks**  \n• Swap **Create Excel** for CSV or Google Sheets node.  \n• Modify column order/names in **Prepare Excel**."
      },
      "typeVersion": 1
    },
    {
      "id": "39c76494-1a64-4756-9f20-81c087c24342",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        384
      ],
      "parameters": {
        "width": 496,
        "height": 288,
        "content": "### Storage Branch  \n**What it does**  \n• Uploads the Excel file to SharePoint (default).  \n• You may replace this node with Google Drive, Dropbox, S3, etc.\n\n**Credentials needed**  \n• SharePoint OAuth2 (or the credential type for your alternative storage)\n\n**User tweaks**  \n• Change folder ID or filename in the upload node.  \n• Replace SharePoint node with your preferred storage provider."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b5041345-234a-450f-85ee-e8f6e1ad045d",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Prepare Excel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Data": {
      "main": [
        [
          {
            "node": "Aggregate Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reddit API": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Config": {
      "main": [
        [
          {
            "node": "Reddit API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Twitter Trends",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Excel": {
      "main": [
        [
          {
            "node": "Microsoft SharePoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Excel": {
      "main": [
        [
          {
            "node": "Create Excel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Content": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Twitter Trends": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流