Récupérer des données de plusieurs sources RSS vers Telegram

Intermédiaire

Ceci est unBuilding Blocksworkflow d'automatisation du domainecontenant 11 nœuds.Utilise principalement des nœuds comme If, Cron, Function, Telegram, RssFeedRead. Récupérer des données de plusieurs sources RSS vers Telegram

Prérequis
  • Token Bot Telegram
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "nodes": [
    {
      "name": "Lecture de flux RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        420,
        -20
      ],
      "parameters": {
        "url": "={{$node[\"SplitInBatches\"].json[\"url\"]}}"
      },
      "typeVersion": 1,
      "id": "Lecture-de-flux-RSS-0"
    },
    {
      "name": "Diviser en lots",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        200,
        -20
      ],
      "parameters": {
        "options": {},
        "batchSize": 1
      },
      "typeVersion": 1,
      "id": "Diviser-en-lots-1"
    },
    {
      "name": "Tâche Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        -240,
        -20
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 10
            }
          ]
        }
      },
      "typeVersion": 1,
      "id": "T-che-Cron-2"
    },
    {
      "name": "uniquement nouveaux RSS",
      "type": "n8n-nodes-base.function",
      "position": [
        640,
        -20
      ],
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newRSSIds = items.map(item => item.json[\"isoDate\"]);\nconst oldRSSIds = staticData.oldRSSIds; \n\nif (!oldRSSIds) {\n  staticData.oldRSSIds = newRSSIds;\n  return items;\n}\n\n\nconst actualNewRSSIds = newRSSIds.filter((id) => !oldRSSIds.includes(id));\nconst actualNewRSS = items.filter((data) => actualNewRSSIds.includes(data.json['isoDate']));\nstaticData.oldRSSIds = [...actualNewRSSIds, ...oldRSSIds];\n\nreturn actualNewRSS;\n"
      },
      "typeVersion": 1,
      "id": "uniquement-nouveaux-RSS-3"
    },
    {
      "name": "Telegram_IT",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1220,
        460
      ],
      "parameters": {
        "text": "={{$json[\"title\"]}}\n{{$json[\"link\"]}}",
        "chatId": "TelegramID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "2",
          "name": "IT_RSS"
        }
      },
      "typeVersion": 1,
      "id": "Telegram_IT-4"
    },
    {
      "name": "Telegram_Security",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1220,
        220
      ],
      "parameters": {
        "text": "={{$json[\"title\"]}}\n{{$json[\"link\"]}}",
        "chatId": "TelegramID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "4",
          "name": "Security_RSS"
        }
      },
      "typeVersion": 1,
      "id": "Telegram_Security-5"
    },
    {
      "name": "Source RSS",
      "type": "n8n-nodes-base.function",
      "position": [
        -20,
        -20
      ],
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      url: 'https://feeds.feedburner.com/UnikosHardware',\n    }\n  },\n  {\n    json: {\n      url: 'http://www.ithome.com.tw/rss.php',\n    }\n  },\n  {\n    json: {\n      url: 'http://feeds.feedburner.com/playpc',\n    }\n  },\n  {\n    json: {\n      url: 'https://lab.ocf.tw/feed/',\n    }\n  },\n  {\n    json: {\n      url: 'https://techcommunity.microsoft.com/plugins/custom/microsoft/o365/custom-blog-rss?tid=3754543230341459569&board=microsoft_365blog',\n    }\n  }\n];"
      },
      "typeVersion": 1,
      "id": "Source-RSS-6"
    },
    {
      "name": "Telegram_M365",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1220,
        -40
      ],
      "parameters": {
        "text": "={{$json[\"title\"]}}\n{{$json[\"link\"]}}",
        "chatId": "TelegramID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "5",
          "name": "M365_RSS"
        }
      },
      "typeVersion": 1,
      "id": "Telegram_M365-7"
    },
    {
      "name": "SI-2",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        240
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"title\"]}}",
              "value2": "資安|資訊安全|安全|外洩|監控|威脅|漏洞|封鎖|修補|攻擊|入侵|個資|隱私|私密|騙|社交工程|釣魚|駭|Security|security|Secure|secure",
              "operation": "regex"
            }
          ]
        },
        "combineOperation": "any"
      },
      "typeVersion": 1,
      "id": "SI-2-8"
    },
    {
      "name": "SI-1",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        -20
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"link\"]}}",
              "value2": "techcommunity.microsoft.com",
              "operation": "contains"
            }
          ]
        }
      },
      "typeVersion": 1,
      "id": "SI-1-9"
    },
    {
      "name": "Fonction de nettoyage",
      "type": "n8n-nodes-base.function",
      "position": [
        -20,
        -180
      ],
      "parameters": {
        "functionCode": "// Get the global workflow static data\nconst staticData = getWorkflowStaticData('global');\n// Update its data\nstaticData.oldRSSIds = new Date().getTime();\n// Delete data\ndelete staticData.oldRSSIds;\n\nreturn [\n  {\n    json: {}\n  }\n]"
      },
      "typeVersion": 1,
      "id": "Fonction-de-nettoyage-10"
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Source-RSS-6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SI-1-9": {
      "main": [
        [
          {
            "node": "Telegram_M365-7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SI-2-8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SI-2-8": {
      "main": [
        [
          {
            "node": "Telegram_Security-5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram_IT-4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Source-RSS-6": {
      "main": [
        [
          {
            "node": "Diviser-en-lots-1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lecture-de-flux-RSS-0": {
      "main": [
        [
          {
            "node": "Diviser-en-lots-1",
            "type": "main",
            "index": 0
          },
          {
            "node": "uniquement-nouveaux-RSS-3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Diviser-en-lots-1": {
      "main": [
        [
          {
            "node": "Lecture-de-flux-RSS-0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "uniquement-nouveaux-RSS-3": {
      "main": [
        [
          {
            "node": "SI-1-9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Blocs de construction

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds11
Catégorie1
Types de nœuds6
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34