Skip to content

Instantly share code, notes, and snippets.

@vongomben
Created July 20, 2022 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vongomben/4000a5047e21f89d34eee9a2758eb90e to your computer and use it in GitHub Desktop.
Save vongomben/4000a5047e21f89d34eee9a2758eb90e to your computer and use it in GitHub Desktop.
[
{
"id": "cc88641a14c03bc7",
"type": "http in",
"z": "f59413a0a9e17cdd",
"name": "",
"url": "/telegram.json",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 330,
"y": 720,
"wires": [
[
"90a21e3a43bac0c9"
]
]
},
{
"id": "34e07d0f670651b9",
"type": "http response",
"z": "f59413a0a9e17cdd",
"name": "",
"statusCode": "",
"headers": {},
"x": 1040,
"y": 720,
"wires": []
},
{
"id": "344ef76f2d841121",
"type": "change",
"z": "f59413a0a9e17cdd",
"name": "Set Headers",
"rules": [
{
"t": "set",
"p": "headers",
"pt": "msg",
"to": "{}",
"tot": "json"
},
{
"t": "set",
"p": "headers.content-type",
"pt": "msg",
"to": "application/json",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 720,
"wires": [
[
"34e07d0f670651b9"
]
]
},
{
"id": "90a21e3a43bac0c9",
"type": "template",
"z": "f59413a0a9e17cdd",
"name": "page",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{ \n \"telegram\": [\n {\n \"message\": \"{{message}}\",\n \"lastUpdate\": \"{{message_time}}\"\n }\n ]\n}",
"output": "str",
"x": 550,
"y": 720,
"wires": [
[
"344ef76f2d841121"
]
]
},
{
"id": "c8c969f79f0ee2bd",
"type": "comment",
"z": "f59413a0a9e17cdd",
"name": "Here the stored data is delivered as Json",
"info": "",
"x": 360,
"y": 680,
"wires": []
},
{
"id": "e77b11b085019825",
"type": "inject",
"z": "f59413a0a9e17cdd",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "message",
"payloadType": "flow",
"x": 650,
"y": 620,
"wires": [
[
"817a0f84c34bb6cf"
]
]
},
{
"id": "817a0f84c34bb6cf",
"type": "debug",
"z": "f59413a0a9e17cdd",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 620,
"wires": []
},
{
"id": "faefd8e5880ec0fc",
"type": "inject",
"z": "f59413a0a9e17cdd",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Hello World!",
"payloadType": "str",
"x": 510,
"y": 560,
"wires": [
[
"91f7f205a7a59a3b"
]
]
},
{
"id": "ac19f6fda9e9d2f9",
"type": "debug",
"z": "f59413a0a9e17cdd",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 910,
"y": 560,
"wires": []
},
{
"id": "91f7f205a7a59a3b",
"type": "change",
"z": "f59413a0a9e17cdd",
"name": "Store message",
"rules": [
{
"t": "set",
"p": "message",
"pt": "flow",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "message_time",
"pt": "flow",
"to": "payload.date",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 720,
"y": 560,
"wires": [
[
"ac19f6fda9e9d2f9"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment