Files
n8n/flows/56.json

677 lines
14 KiB
JSON

{
"id": 56,
"name": "olx final",
"active": true,
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
200,
-40
]
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"value": 15,
"unit": "minutes"
}
]
}
},
"name": "Cron2",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [
200,
220
]
},
{
"parameters": {
"operation": "create",
"docId": "d61nLm6Fn99jwqxd6hdT9d",
"tableId": "Items",
"dataToSend": "autoMapInputs"
},
"name": "Grist",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
3040,
200
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "link",
"value": "={{$node[\"IF\"].json[\"link\"]}}"
},
{
"name": "tag",
"value": "={{$node[\"IF\"].json[\"tag\"]}}"
},
{
"name": "city",
"value": "={{$node[\"IF\"].json[\"city\"]}}"
},
{
"name": "date",
"value": "={{$now.toString()}}"
}
]
},
"options": {}
},
"name": "Set1",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
2860,
200
]
},
{
"parameters": {
"url": "={{$json[\"url\"]}}",
"responseFormat": "string",
"options": {
"batchSize": 20
}
},
"name": "HTTP Request3",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
620,
20
]
},
{
"parameters": {
"extractionValues": {
"values": [
{
"key": "items",
"cssSelector": "div.css-19ucd76",
"returnValue": "html",
"returnArray": true
}
]
},
"options": {}
},
"name": "HTML Extract3",
"type": "n8n-nodes-base.htmlExtract",
"typeVersion": 1,
"position": [
820,
20
]
},
{
"parameters": {
"fieldToSplitOut": "items",
"include": "allOtherFields",
"options": {}
},
"name": "Item Lists1",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
1220,
20
]
},
{
"parameters": {
"dataPropertyName": "items",
"extractionValues": {
"values": [
{
"key": "link",
"cssSelector": "a.css-1bbgabe",
"returnValue": "attribute",
"attribute": "href"
},
{
"key": "city",
"cssSelector": "p.css-p6wsjo-Text.eu5v0x0"
}
]
},
"options": {}
},
"name": "HTML Extract4",
"type": "n8n-nodes-base.htmlExtract",
"typeVersion": 1,
"position": [
1420,
20
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json[\"link\"]}}",
"operation": "isNotEmpty"
},
{
"value1": "={{$json[\"city\"]}}",
"operation": "contains",
"value2": "Сегодня"
},
{
"value1": "={{$json[\"city\"]}}",
"operation": "isNotEmpty"
}
]
}
},
"name": "IF1",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1780,
20
]
},
{
"parameters": {
"docId": "d61nLm6Fn99jwqxd6hdT9d",
"tableId": "Url",
"additionalOptions": {}
},
"name": "get url",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
420,
20
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "tag",
"value": "={{$node[\"get url\"].json[\"tag\"]}}"
},
{
"name": "items",
"value": "={{$json[\"items\"]}}"
},
{
"name": "filter",
"value": "={{$node[\"get url\"].json[\"filter\"]}}"
}
]
},
"options": {}
},
"name": "Set items",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1020,
20
]
},
{
"parameters": {
"mode": "removeKeyMatches",
"propertyName1": "link",
"propertyName2": "link"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
2060,
20
]
},
{
"parameters": {
"docId": "d61nLm6Fn99jwqxd6hdT9d",
"tableId": "Items",
"returnAll": true,
"additionalOptions": {}
},
"name": "Grist2",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
1800,
220
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"url": "={{$json[\"link\"]}}",
"responseFormat": "string",
"options": {}
},
"name": "HTTP Request4",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
2460,
20
]
},
{
"parameters": {
"extractionValues": {
"values": [
{
"key": "price",
"cssSelector": "h3.css-okktvh-Text.eu5v0x0"
},
{
"key": "content",
"cssSelector": "div.css-g5mtbi-Text"
},
{
"key": "image",
"cssSelector": "img.css-1bmvjcs",
"returnValue": "attribute",
"attribute": "src"
},
{
"key": "title",
"cssSelector": "h1.css-r9zjja-Text.eu5v0x0"
}
]
},
"options": {
"trimValues": true
}
},
"name": "HTML Extract5",
"type": "n8n-nodes-base.htmlExtract",
"typeVersion": 1,
"position": [
2640,
20
]
},
{
"parameters": {
"operation": "multiStep",
"operations": {
"operations": [
{
"operation": "resize",
"width": 300,
"height": -1,
"resizeOption": "onlyIfLarger"
},
{
"operation": "crop",
"width": 300,
"height": 100,
"positionY": 75
}
]
},
"options": {}
},
"name": "Edit Image1",
"type": "n8n-nodes-base.editImage",
"typeVersion": 1,
"position": [
3040,
-260
]
},
{
"parameters": {
"url": "={{$json[\"image\"]}}",
"responseFormat": "file",
"options": {}
},
"name": "HTTP Request5",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
2880,
-240
]
},
{
"parameters": {
"operation": "sendPhoto",
"chatId": "1684481",
"binaryData": true,
"additionalFields": {
"caption": "=#{{$node[\"IF\"].json[\"tag\"]}}\n<b>{{$json[\"title\"]}} - {{$json[\"price\"]}}</b>\n📍 <i>{{$node[\"IF\"].json[\"city\"]}}</i>\n<a href=\"{{$node[\"IF\"].json[\"link\"]}}\">Подробнее</a>",
"parse_mode": "HTML"
}
},
"name": "Telegram1",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
3260,
-260
],
"credentials": {
"telegramApi": {
"id": "31",
"name": "Telegram account"
}
}
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json[\"link\"]}}",
"operation": "contains",
"value2": "={{$json[\"filter\"]}}"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
2240,
20
]
},
{
"parameters": {
"chatId": "1684481",
"text": "=#{{$node[\"IF\"].json[\"tag\"]}}\n<b>{{$json[\"title\"]}} - {{$json[\"price\"]}}</b>\n📍 <i>{{$node[\"IF\"].json[\"city\"]}}</i>\n<a href=\"{{$node[\"IF\"].json[\"link\"]}}\">Подробнее</a>",
"additionalFields": {
"parse_mode": "HTML"
}
},
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
3040,
20
],
"credentials": {
"telegramApi": {
"id": "31",
"name": "Telegram account"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "link",
"value": "=https://m.olx.ua{{$json[\"link\"]}}"
},
{
"name": "tag",
"value": "={{$node[\"Item Lists1\"].json[\"tag\"]}}"
},
{
"name": "filter",
"value": "={{$node[\"Item Lists1\"].json[\"filter\"]}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1600,
20
]
}
],
"connections": {
"Cron2": {
"main": [
[
{
"node": "get url",
"type": "main",
"index": 0
}
]
]
},
"Set1": {
"main": [
[
{
"node": "Grist",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request3": {
"main": [
[
{
"node": "HTML Extract3",
"type": "main",
"index": 0
}
]
]
},
"HTML Extract3": {
"main": [
[
{
"node": "Set items",
"type": "main",
"index": 0
}
]
]
},
"Item Lists1": {
"main": [
[
{
"node": "HTML Extract4",
"type": "main",
"index": 0
}
]
]
},
"HTML Extract4": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"IF1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"get url": {
"main": [
[
{
"node": "HTTP Request3",
"type": "main",
"index": 0
}
]
]
},
"Set items": {
"main": [
[
{
"node": "Item Lists1",
"type": "main",
"index": 0
}
]
]
},
"Grist2": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Merge": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request4": {
"main": [
[
{
"node": "HTML Extract5",
"type": "main",
"index": 0
}
]
]
},
"Edit Image1": {
"main": [
[
{
"node": "Telegram1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request5": {
"main": [
[
{
"node": "Edit Image1",
"type": "main",
"index": 0
}
]
]
},
"HTML Extract5": {
"main": [
[
{
"node": "Set1",
"type": "main",
"index": 0
},
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "HTTP Request4",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "IF1",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2022-07-18T17:30:44.606Z",
"updatedAt": "2022-07-31T18:04:21.903Z",
"settings": {
"errorWorkflow": "25"
},
"staticData": null,
"pinData": {},
"tags": [
{
"id": "3",
"name": "olx",
"createdAt": "2022-06-21T19:20:51.822Z",
"updatedAt": "2022-06-21T19:20:51.822Z"
}
]
}