Files
n8n-workspace/MyDealzBest.json
2001-01-01 00:00:00 +00:00

720 lines
25 KiB
JSON

{
"updatedAt": "2025-12-09T19:02:18.000Z",
"createdAt": "2025-12-08T10:31:16.680Z",
"id": "GR1gqXtazt67q0cb",
"name": "MyDealzBest",
"active": true,
"isArchived": false,
"nodes": [
{
"parameters": {
"url": "https://www.mydealz.de/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
224,
0
],
"id": "2d03a805-1669-4fae-bba8-82e75fce401f",
"name": "HTTP Request",
"retryOnFail": false
},
{
"parameters": {
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "deal",
"cssSelector": ".thread--deal",
"returnValue": "html",
"returnArray": true
}
]
},
"options": {
"trimValues": false,
"cleanUpText": false
}
},
"type": "n8n-nodes-base.html",
"typeVersion": 1.2,
"position": [
432,
0
],
"id": "61eab985-2ef7-4eb1-980a-be843607a6f4",
"name": "HTML"
},
{
"parameters": {
"operation": "extractHtmlContent",
"dataPropertyName": "deal",
"extractionValues": {
"values": [
{
"key": "title",
"cssSelector": ".thread-link",
"returnValue": "attribute",
"attribute": "title"
},
{
"key": "href",
"cssSelector": ".thread-link",
"returnValue": "attribute",
"attribute": "href"
},
{
"key": "price",
"cssSelector": ".js-vue3",
"returnValue": "attribute",
"attribute": "data-vue3"
}
]
},
"options": {
"trimValues": false
}
},
"type": "n8n-nodes-base.html",
"typeVersion": 1.2,
"position": [
640,
0
],
"id": "4b37c3af-a7ff-4c06-99e9-f658d85d577e",
"name": "HTML1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "d24b314b-ed33-42c0-8c8f-6552572fd5a6",
"name": "thread_id",
"value": "={{ $json.price.match(\"threadId\\\":\\\"([0-9]+)\")[1]}}",
"type": "number"
},
{
"id": "319ad3c4-299a-4083-96bb-166205377465",
"name": "price",
"value": "={{ $json.price.match(\"price\\\":([0-9.]+)\")[1] }}",
"type": "number"
},
{
"id": "0535fa09-5dcd-4287-9f04-d612fba1b5a1",
"name": "nextBestPrice",
"value": "={{ $json.price.match(\"nextBestPrice\\\":([0-9.]+)\")[1]}}",
"type": "number"
},
{
"id": "1e476b3e-1a4c-40b3-89b2-9600352a1c69",
"name": "isHot",
"value": "={{ $json.price.match(\"isHot\\\":(true|false),\\\"\")[1]}}",
"type": "boolean"
},
{
"id": "4b14ec00-4e9a-4be2-b170-b6217ee95cbb",
"name": "temperature",
"value": "={{ $json.price.match(\"temperatureLevel\\\":\\\"(.*?)\\\",\")[1]}}",
"type": "string"
}
]
},
"includeOtherFields": true,
"include": "except",
"excludeFields": "price",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
848,
0
],
"id": "bb646ae1-eb22-490d-be64-600dd0d4995e",
"name": "Edit Fields"
},
{
"parameters": {
"operation": "select",
"schema": {
"__rl": true,
"value": "dealz",
"mode": "list",
"cachedResultName": "dealz"
},
"table": {
"__rl": true,
"value": "deals",
"mode": "list",
"cachedResultName": "deals"
},
"where": {
"values": [
{
"column": "send",
"value": "false"
}
]
},
"sort": {
"values": [
{
"column": "temperature",
"direction": "DESC"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
1328,
0
],
"id": "444e568f-7ca2-4f06-addc-c919b4b22cfd",
"name": "Select rows from a table",
"executeOnce": true,
"credentials": {
"postgres": {
"id": "KfuCkzCoRyZId8cM",
"name": "Postgress-MyDealz"
}
}
},
{
"parameters": {
"operation": "upsert",
"schema": {
"__rl": true,
"value": "dealz",
"mode": "list",
"cachedResultName": "dealz"
},
"table": {
"__rl": true,
"value": "deals",
"mode": "list",
"cachedResultName": "deals"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"ishot": "={{ $json.isHot }}",
"thread_id": "={{ $json.thread_id }}",
"title": "={{ $json.title }}",
"price": "={{ $json.price }}",
"nextbestprice": "={{ $json.nextBestPrice }}",
"url": "={{ $json.href }}",
"temperature": "={{ $json.temperature }}"
},
"matchingColumns": [
"thread_id"
],
"schema": [
{
"id": "thread_id",
"displayName": "thread_id",
"required": true,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "title",
"displayName": "title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false
},
{
"id": "temperature",
"displayName": "temperature",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": false
},
{
"id": "price",
"displayName": "price",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": false
},
{
"id": "nextbestprice",
"displayName": "nextbestprice",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": false
},
{
"id": "ishot",
"displayName": "ishot",
"required": false,
"defaultMatch": false,
"display": true,
"type": "boolean",
"canBeUsedToMatch": false
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": false
},
{
"id": "updated_at",
"displayName": "updated_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
1088,
0
],
"id": "b21d664f-480f-4393-bb6b-8c303009b0ce",
"name": "Insert or update rows in a table",
"executeOnce": false,
"credentials": {
"postgres": {
"id": "KfuCkzCoRyZId8cM",
"name": "Postgress-MyDealz"
}
}
},
{
"parameters": {
"operation": "update",
"schema": {
"__rl": true,
"value": "dealz",
"mode": "list",
"cachedResultName": "dealz"
},
"table": {
"__rl": true,
"value": "deals",
"mode": "list",
"cachedResultName": "deals"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"send": true,
"updated_at": "={{ $now }}",
"thread_id": "={{ $json.thread_id }}"
},
"matchingColumns": [
"thread_id"
],
"schema": [
{
"id": "thread_id",
"displayName": "thread_id",
"required": true,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "title",
"displayName": "title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "temperature",
"displayName": "temperature",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "price",
"displayName": "price",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "nextbestprice",
"displayName": "nextbestprice",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "ishot",
"displayName": "ishot",
"required": false,
"defaultMatch": false,
"display": true,
"type": "boolean",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "send",
"displayName": "send",
"required": false,
"defaultMatch": false,
"display": true,
"type": "boolean",
"canBeUsedToMatch": true
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "updated_at",
"displayName": "updated_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
1776,
-128
],
"id": "f178423a-30e2-471d-82ac-a0b89224ba6b",
"name": "Update rows in a table",
"credentials": {
"postgres": {
"id": "KfuCkzCoRyZId8cM",
"name": "Postgress-MyDealz"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 2,
"triggerAtMinute": "={{ 0 }}"
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-400,
0
],
"id": "9d501eff-0b54-483c-b87b-61e9c08c8722",
"name": "Schedule Trigger"
},
{
"parameters": {
"jsCode": "// Konfiguration: Wieviele Minuten maximal warten?\nconst minMinutes = 1;\nconst maxMinutes = 25;\n\n// Zufallsberechnung in Sekunden\nconst randomSeconds = Math.floor(Math.random() * (maxMinutes * 60 - minMinutes * 60 + 1) + minMinutes * 60);\n\nreturn [\n {\n json: {\n wait_time: randomSeconds,\n info: `Ich warte jetzt ${Math.floor(randomSeconds / 60)} Minuten und ${randomSeconds % 60} Sekunden.`\n }\n }\n];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-192,
0
],
"id": "6c8dc53e-fd22-446a-86f9-e16ed10adfb5",
"name": "Code in JavaScript"
},
{
"parameters": {
"amount": "={{ $json.wait_time }}"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
0,
0
],
"id": "5f231f91-012c-4e28-b17d-eca914e009e7",
"name": "Wait",
"webhookId": "2506d52b-677e-4ff1-ab1a-315ab75f9408"
},
{
"parameters": {
"chatId": "=302560724",
"text": "={{ $json.price }}€ / {{ $json.nextbestprice }}€ {{ $json.temperature == \"Hot1\" ? \"🔥\" : $json.temperature == \"Hot2\" ? \"🔥🔥\" : $json.temperature == \"Hot3\" ? \"🔥🔥🔥\" : $json.temperature == \"Hot4\" ? \"🔥🔥🔥🔥\" : \"❄️\"}}\n\n{{ $json.url }}",
"additionalFields": {
"appendAttribution": false,
"disable_web_page_preview": false,
"parse_mode": "HTML"
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1776,
0
],
"id": "30468d2b-44ef-41f0-9155-85b64c533882",
"name": "Send a text message",
"webhookId": "6bb12551-6d47-40b7-8ffc-594e66295b8f",
"credentials": {
"telegramApi": {
"id": "k5rX2fD1IwPWwuCY",
"name": "Telegram_mydealzcmts_bot"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "6114b468-a308-4865-90fd-c8f72049cbe3",
"name": "temperature",
"value": "=",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1568,
128
],
"id": "f456d7df-98c6-46dc-8f83-45c33547dcef",
"name": "Edit Fields1"
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "HTML",
"type": "main",
"index": 0
}
]
]
},
"HTML": {
"main": [
[
{
"node": "HTML1",
"type": "main",
"index": 0
}
]
]
},
"HTML1": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Insert or update rows in a table",
"type": "main",
"index": 0
}
]
]
},
"Insert or update rows in a table": {
"main": [
[
{
"node": "Select rows from a table",
"type": "main",
"index": 0
}
]
]
},
"Select rows from a table": {
"main": [
[
{
"node": "Update rows in a table",
"type": "main",
"index": 0
},
{
"node": "Send a text message",
"type": "main",
"index": 0
},
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Update rows in a table": {
"main": [
[]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Send a text message": {
"main": [
[]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": {
"node:Schedule Trigger": {
"recurrenceRules": [
0
]
}
},
"meta": {
"templateCredsSetupCompleted": true
},
"pinData": {},
"versionId": "bf7631d5-bf3d-4bfd-99a3-d4678e835067",
"triggerCount": 1,
"shared": [
{
"updatedAt": "2025-12-08T10:31:16.683Z",
"createdAt": "2025-12-08T10:31:16.683Z",
"role": "workflow:owner",
"workflowId": "GR1gqXtazt67q0cb",
"projectId": "S4tmpzSj6JlGFOze"
}
],
"tags": []
}