754 lines
15 KiB
JSON
Executable File
754 lines
15 KiB
JSON
Executable File
{
|
|
"createdAt": "2022-07-18T17:30:44.606Z",
|
|
"updatedAt": "2022-08-04T09:05:57.212Z",
|
|
"id": 56,
|
|
"name": "olx final",
|
|
"active": true,
|
|
"nodes": [
|
|
{
|
|
"parameters": {},
|
|
"name": "Start",
|
|
"type": "n8n-nodes-base.start",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
200,
|
|
-40
|
|
],
|
|
"id": "de16547c-d521-48c5-a9f0-a66833478aaa"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"triggerTimes": {
|
|
"item": [
|
|
{
|
|
"mode": "everyX",
|
|
"value": 15,
|
|
"unit": "minutes"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "Cron2",
|
|
"type": "n8n-nodes-base.cron",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
200,
|
|
260
|
|
],
|
|
"id": "e87c4d6d-641e-42f3-b00e-bedadf06c7ba"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"operation": "create",
|
|
"docId": "d61nLm6Fn99jwqxd6hdT9d",
|
|
"tableId": "Items",
|
|
"dataToSend": "autoMapInputs"
|
|
},
|
|
"name": "Grist",
|
|
"type": "n8n-nodes-base.grist",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
3180,
|
|
180
|
|
],
|
|
"id": "af87dff3-b055-4600-ad98-814c0bd8c11d",
|
|
"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": [
|
|
2980,
|
|
180
|
|
],
|
|
"id": "74d9d7ad-6ea0-423d-84a6-a896b00f24d2"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"url": "={{$json[\"url\"]}}",
|
|
"responseFormat": "string",
|
|
"options": {}
|
|
},
|
|
"name": "HTTP Request3",
|
|
"type": "n8n-nodes-base.httpRequest",
|
|
"typeVersion": 2,
|
|
"position": [
|
|
780,
|
|
0
|
|
],
|
|
"id": "7093ed10-1cc1-4275-825a-5a2daece858c"
|
|
},
|
|
{
|
|
"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": [
|
|
940,
|
|
0
|
|
],
|
|
"id": "ba770d6e-e70e-485b-a737-5b673d6fac73"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"fieldToSplitOut": "items",
|
|
"include": "allOtherFields",
|
|
"options": {
|
|
"destinationFieldName": ""
|
|
}
|
|
},
|
|
"name": "Item Lists1",
|
|
"type": "n8n-nodes-base.itemLists",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
1300,
|
|
0
|
|
],
|
|
"id": "bf3adaed-0ce8-413e-a300-60fea4705d03"
|
|
},
|
|
{
|
|
"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": [
|
|
1500,
|
|
0
|
|
],
|
|
"id": "5d8bee6c-1d8b-4135-a4c7-2b4eff38434e"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"string": [
|
|
{
|
|
"value1": "={{$json[\"link\"]}}",
|
|
"operation": "isNotEmpty"
|
|
},
|
|
{
|
|
"value1": "={{$json[\"city\"]}}",
|
|
"operation": "contains",
|
|
"value2": "Сегодня"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "IF1",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
1880,
|
|
0
|
|
],
|
|
"id": "290731f6-16e9-492d-8c20-782390d7bf10"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"docId": "d61nLm6Fn99jwqxd6hdT9d",
|
|
"tableId": "Url",
|
|
"returnAll": true,
|
|
"additionalOptions": {}
|
|
},
|
|
"name": "get url",
|
|
"type": "n8n-nodes-base.grist",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
420,
|
|
20
|
|
],
|
|
"id": "c29f1c92-3353-4359-8710-e5e49ee3387e",
|
|
"credentials": {
|
|
"gristApi": {
|
|
"id": "21",
|
|
"name": "Grist account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"keepOnlySet": true,
|
|
"values": {
|
|
"string": [
|
|
{
|
|
"name": "tag",
|
|
"value": "={{$node[\"IF3\"].json[\"tag\"]}}"
|
|
},
|
|
{
|
|
"name": "items",
|
|
"value": "={{$json[\"items\"]}}"
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"value": "={{$node[\"IF3\"].json[\"filter\"]}}"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"name": "Set items",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
1120,
|
|
0
|
|
],
|
|
"id": "7361270e-d2e2-40e0-b75f-d4d67d9cf9b7"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"mode": "removeKeyMatches",
|
|
"propertyName1": "link",
|
|
"propertyName2": "link"
|
|
},
|
|
"name": "Merge",
|
|
"type": "n8n-nodes-base.merge",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
2120,
|
|
0
|
|
],
|
|
"id": "30464610-8eab-433f-b16d-946b37feb25a"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"docId": "d61nLm6Fn99jwqxd6hdT9d",
|
|
"tableId": "Items",
|
|
"returnAll": true,
|
|
"additionalOptions": {}
|
|
},
|
|
"name": "Grist2",
|
|
"type": "n8n-nodes-base.grist",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
1880,
|
|
220
|
|
],
|
|
"id": "c9981bf9-9680-4285-a541-53d60fc5cb51",
|
|
"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": [
|
|
2560,
|
|
-20
|
|
],
|
|
"id": "840f0f33-51d4-447f-a80b-1b954d693af5"
|
|
},
|
|
{
|
|
"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": [
|
|
2760,
|
|
-20
|
|
],
|
|
"id": "dd30fb8a-a61d-4ccc-9d1d-9b5b381dbb6f"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"string": [
|
|
{
|
|
"value1": "={{$json[\"link\"]}}",
|
|
"operation": "contains",
|
|
"value2": "={{$json[\"filter\"]}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "IF",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
2320,
|
|
0
|
|
],
|
|
"id": "15b02816-a39a-4ebd-94d6-829d0fdac228"
|
|
},
|
|
{
|
|
"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": [
|
|
2960,
|
|
-20
|
|
],
|
|
"id": "204a3fb3-aea1-4047-9bc0-8a3fa2a88336",
|
|
"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": [
|
|
1680,
|
|
0
|
|
],
|
|
"id": "4cb8528b-88a3-4cdb-aab8-5ad8f01013d4"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"docId": "d61nLm6Fn99jwqxd6hdT9d",
|
|
"tableId": "Items",
|
|
"returnAll": true,
|
|
"additionalOptions": {}
|
|
},
|
|
"name": "Grist3",
|
|
"type": "n8n-nodes-base.grist",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
420,
|
|
260
|
|
],
|
|
"id": "7f5ca892-e4c4-42b0-a11a-1bbcec8463ec",
|
|
"credentials": {
|
|
"gristApi": {
|
|
"id": "21",
|
|
"name": "Grist account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"dateTime": [
|
|
{
|
|
"value1": "={{ $json[\"data\"] }}",
|
|
"operation": "before",
|
|
"value2": "={{$today.minus({days: 14}).toString()}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "IF2",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
820,
|
|
260
|
|
],
|
|
"id": "3151a1cd-04f1-467e-af31-b065c5e55f8d"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"value": "={{ $json[\"date\"] }}",
|
|
"toFormat": "YYYY-MM-DD",
|
|
"options": {
|
|
"fromFormat": "X"
|
|
}
|
|
},
|
|
"name": "Date & Time",
|
|
"type": "n8n-nodes-base.dateTime",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
620,
|
|
260
|
|
],
|
|
"id": "c72abc1d-c604-4624-9be0-40ac2b057409"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"operation": "delete",
|
|
"docId": "d61nLm6Fn99jwqxd6hdT9d",
|
|
"tableId": "Items",
|
|
"rowId": "={{ $json[\"id\"] }}"
|
|
},
|
|
"name": "Grist4",
|
|
"type": "n8n-nodes-base.grist",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
1020,
|
|
240
|
|
],
|
|
"id": "aea4fd53-5ea8-4529-9621-60371e5b69c6",
|
|
"credentials": {
|
|
"gristApi": {
|
|
"id": "21",
|
|
"name": "Grist account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"boolean": [
|
|
{
|
|
"value1": "={{ $json[\"active\"] }}",
|
|
"value2": true
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "IF3",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
580,
|
|
20
|
|
],
|
|
"id": "6c41f659-aede-46f8-a432-de09d295057e"
|
|
}
|
|
],
|
|
"connections": {
|
|
"Cron2": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "get url",
|
|
"type": "main",
|
|
"index": 0
|
|
},
|
|
{
|
|
"node": "Grist3",
|
|
"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": "IF3",
|
|
"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
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"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
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Grist3": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Date & Time",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"IF2": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Grist4",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Date & Time": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "IF2",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"IF3": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "HTTP Request3",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"settings": {
|
|
"errorWorkflow": "25"
|
|
},
|
|
"staticData": null,
|
|
"pinData": {},
|
|
"tags": [
|
|
{
|
|
"createdAt": "2022-06-21T19:20:51.822Z",
|
|
"updatedAt": "2022-06-21T19:20:51.822Z",
|
|
"id": "3",
|
|
"name": "olx"
|
|
}
|
|
]
|
|
} |