Advertisement
NittyGritty

Pelletpreise

Nov 17th, 2023
1,055
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 5.47 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "e5cbb3eee7041f2b",
  4.         "type": "debug",
  5.         "z": "dabdc8fc290e3b36",
  6.         "name": "Lose Pellets",
  7.         "active": true,
  8.         "tosidebar": false,
  9.         "console": false,
  10.         "tostatus": true,
  11.         "complete": "payload",
  12.         "targetType": "msg",
  13.         "statusVal": "payload",
  14.         "statusType": "auto",
  15.         "x": 950,
  16.         "y": 80,
  17.         "wires": []
  18.     },
  19.     {
  20.         "id": "8ddc1085d9f840e4",
  21.         "type": "debug",
  22.         "z": "dabdc8fc290e3b36",
  23.         "name": "debug 12",
  24.         "active": true,
  25.         "tosidebar": false,
  26.         "console": false,
  27.         "tostatus": true,
  28.         "complete": "payload",
  29.         "targetType": "msg",
  30.         "statusVal": "payload",
  31.         "statusType": "auto",
  32.         "x": 940,
  33.         "y": 140,
  34.         "wires": []
  35.     },
  36.     {
  37.         "id": "8fcd81c469b747f2",
  38.         "type": "debug",
  39.         "z": "dabdc8fc290e3b36",
  40.         "name": "Pelletes Sackware",
  41.         "active": true,
  42.         "tosidebar": false,
  43.         "console": false,
  44.         "tostatus": true,
  45.         "complete": "payload",
  46.         "targetType": "msg",
  47.         "statusVal": "payload",
  48.         "statusType": "auto",
  49.         "x": 970,
  50.         "y": 220,
  51.         "wires": []
  52.     },
  53.     {
  54.         "id": "6a99e3f6cf2e0662",
  55.         "type": "debug",
  56.         "z": "dabdc8fc290e3b36",
  57.         "name": "debug 17",
  58.         "active": true,
  59.         "tosidebar": false,
  60.         "console": false,
  61.         "tostatus": true,
  62.         "complete": "payload",
  63.         "targetType": "msg",
  64.         "statusVal": "payload",
  65.         "statusType": "auto",
  66.         "x": 940,
  67.         "y": 280,
  68.         "wires": []
  69.     },
  70.     {
  71.         "id": "0fc5234932db8552",
  72.         "type": "function",
  73.         "z": "dabdc8fc290e3b36",
  74.         "name": "function 5",
  75.         "func": "var EuroPos=0;\nvar DatumPos=0\nvar count=0;\n\n// find Pragraph containing Euro Price\n\nfor (var i = 0; i < 30; i++) {\n    if (msg.payload[i].includes(\"Aktueller Preis\")) {\n        break;\n        }\n    else\n     { count++;}\n}\n\nEuroPos = count+1;\nDatumPos= count+2;\n\n// var EuroPos = 18;\n// var DatumPos = 19\n\nvar words = msg.payload[EuroPos].split(' ');\nvar Preis = (words[0]) + \" Euro\";\n\nwords = msg.payload[DatumPos].split(',');\nvar Datum = words[0];\n\nvar Zeit = words[1];\nwords = Zeit.split(' ');\nZeit = words[1] + \":00\";\n\nvar pattern = /(\\d{2})\\.(\\d{2})\\.(\\d{4})/;\nvar dt = Datum.replace(pattern, '$3-$2-$1') + \" \" + Zeit;\n// var dt = new Date(Datum.replace(pattern, '$3-$2-$1') + Zeit );\ndt = new Date(dt);\n// ----------------------------------------\nEuroPos = EuroPos + 3;\nDatumPos = DatumPos + 3;\n\nvar words = msg.payload[EuroPos].split(' ');\nvar Preis1 = (words[0]) + \" Euro\";\n\nwords = msg.payload[DatumPos].split(',');\nvar Datum = words[0];\n\nvar Zeit = words[1];\nwords = Zeit.split(' ');\nZeit = words[1] + \":00\";\n\nvar pattern = /(\\d{2})\\.(\\d{2})\\.(\\d{4})/;\nvar dt1 = Datum.replace(pattern, '$3-$2-$1') + \" \" + Zeit;\n// var dt = new Date(Datum.replace(pattern, '$3-$2-$1') + Zeit );\ndt1 = new Date(dt);\n\nnode.status({\n    fill: \"green\",\n    shape: \"ring\",\n    text:   \"Preis: \" + Preis +\n            \", Datum: \" + Datum +\n            \", Zeit: \" + Zeit +\n            \", Count: \" + count\n});\n\n\nreturn [{ payload: Preis }, { payload: dt }, { payload: Preis1 }, { payload: dt1 }];",
  76.         "outputs": 4,
  77.         "noerr": 0,
  78.         "initialize": "",
  79.         "finalize": "",
  80.         "libs": [],
  81.         "x": 720,
  82.         "y": 300,
  83.         "wires": [
  84.             [
  85.                 "e5cbb3eee7041f2b"
  86.             ],
  87.             [
  88.                 "8ddc1085d9f840e4"
  89.             ],
  90.             [
  91.                 "8fcd81c469b747f2"
  92.             ],
  93.             [
  94.                 "6a99e3f6cf2e0662"
  95.             ]
  96.         ]
  97.     },
  98.     {
  99.         "id": "7c04d5770e17ef16",
  100.         "type": "html",
  101.         "z": "dabdc8fc290e3b36",
  102.         "name": "",
  103.         "property": "payload",
  104.         "outproperty": "payload",
  105.         "tag": "p",
  106.         "ret": "html",
  107.         "as": "single",
  108.         "x": 550,
  109.         "y": 300,
  110.         "wires": [
  111.             [
  112.                 "0fc5234932db8552"
  113.             ]
  114.         ]
  115.     },
  116.     {
  117.         "id": "32132abba67ed588",
  118.         "type": "http request",
  119.         "z": "dabdc8fc290e3b36",
  120.         "name": "",
  121.         "method": "GET",
  122.         "ret": "txt",
  123.         "paytoqs": "ignore",
  124.         "url": "https://www.holzpellets.net/pelletspreise/",
  125.         "tls": "",
  126.         "persist": false,
  127.         "proxy": "",
  128.         "insecureHTTPParser": false,
  129.         "authType": "",
  130.         "senderr": false,
  131.         "headers": [],
  132.         "x": 370,
  133.         "y": 300,
  134.         "wires": [
  135.             [
  136.                 "7c04d5770e17ef16",
  137.                 "f266365a77668506"
  138.             ]
  139.         ]
  140.     },
  141.     {
  142.         "id": "f88dc0dd72cd0a25",
  143.         "type": "inject",
  144.         "z": "dabdc8fc290e3b36",
  145.         "name": "",
  146.         "props": [
  147.             {
  148.                 "p": "payload"
  149.             },
  150.             {
  151.                 "p": "topic",
  152.                 "vt": "str"
  153.             }
  154.         ],
  155.         "repeat": "",
  156.         "crontab": "",
  157.         "once": false,
  158.         "onceDelay": 0.1,
  159.         "topic": "",
  160.         "payload": "",
  161.         "payloadType": "date",
  162.         "x": 140,
  163.         "y": 300,
  164.         "wires": [
  165.             [
  166.                 "32132abba67ed588"
  167.             ]
  168.         ]
  169.     }
  170. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement