Skip to content

Instantly share code, notes, and snippets.

@kitchung
Forked from redphx/stock_alert.json
Created May 24, 2022 03:54
Show Gist options
  • Save kitchung/4cbca4cb1692b97d7ae06e75a898c357 to your computer and use it in GitHub Desktop.
Save kitchung/4cbca4cb1692b97d7ae06e75a898c357 to your computer and use it in GitHub Desktop.
Stock alert using Node-RED
[
{
"id": "bbd65f58de8fc93e",
"type": "group",
"z": "5501e19c.72a0c",
"name": "Coral USB",
"style": {
"label": true
},
"nodes": [
"a3d0c7f4a380c7aa",
"3dff10cd666dd772",
"e5b9c08c3a869382",
"4935a2bcac54b0c0",
"9c1592a0b33f06c1",
"4a159d76e74d944c"
],
"x": 94,
"y": 659,
"w": 1372,
"h": 82
},
{
"id": "a3d0c7f4a380c7aa",
"type": "http request",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://www.example.com/coral-usb",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"credentials": {
"user": "",
"password": ""
},
"x": 430,
"y": 700,
"wires": [
[
"9c1592a0b33f06c1"
]
]
},
{
"id": "3dff10cd666dd772",
"type": "switch",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "<div class=\"out-of-stock stock\">",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 850,
"y": 700,
"wires": [
[],
[
"4935a2bcac54b0c0"
]
]
},
{
"id": "e5b9c08c3a869382",
"type": "api-call-service",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"server": "20327e2.7052382",
"version": 5,
"debugenabled": false,
"domain": "notify",
"service": "telegram_me",
"areaId": [],
"deviceId": [],
"entityId": [],
"data": "{\"message\":\"Seed Coral USB is back in stock https://example.com...\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1340,
"y": 700,
"wires": [
[]
]
},
{
"id": "4935a2bcac54b0c0",
"type": "trigger",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"op1": "1",
"op2": "0",
"op1type": "num",
"op2type": "str",
"duration": "-10",
"extend": false,
"overrideDelay": false,
"units": "min",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1070,
"y": 700,
"wires": [
[
"e5b9c08c3a869382"
]
]
},
{
"id": "9c1592a0b33f06c1",
"type": "switch",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"property": "statusCode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "200",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 650,
"y": 700,
"wires": [
[
"3dff10cd666dd772"
]
]
},
{
"id": "4a159d76e74d944c",
"type": "inject",
"z": "5501e19c.72a0c",
"g": "bbd65f58de8fc93e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "600",
"crontab": "",
"once": true,
"onceDelay": "10",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 210,
"y": 700,
"wires": [
[
"a3d0c7f4a380c7aa"
]
]
},
{
"id": "20327e2.7052382",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment