diff --git a/flows.json b/flows.json index ba2a5cd8..5ce4ae07 100644 --- a/flows.json +++ b/flows.json @@ -1,11 +1,4 @@ [ - { - "id": "f6f2187d.f17ca8", - "type": "tab", - "label": "Flow 1", - "disabled": false, - "info": "" - }, { "id": "e677d300.d1d95", "type": "tab", @@ -27,6 +20,20 @@ "disabled": false, "info": "" }, + { + "id": "3645fb833bf0fede", + "type": "tab", + "label": "Gregory | Machine Learning", + "disabled": false, + "info": "" + }, + { + "id": "9297a3d188e4e9d4", + "type": "tab", + "label": "Gregory | SQLite CRUD", + "disabled": false, + "info": "" + }, { "id": "acf883d8.84eea", "type": "subflow", @@ -59,6 +66,39 @@ "env": [], "color": "#DDAA99" }, + { + "id": "d353eec5835441c0", + "type": "subflow", + "name": "throttle requests", + "info": "", + "category": "", + "in": [ + { + "x": 120, + "y": 160, + "wires": [ + { + "id": "eb444d3ffa4f324c" + } + ] + } + ], + "out": [ + { + "x": 660, + "y": 160, + "wires": [ + { + "id": "d5716d48a6a85ee3", + "port": 0 + } + ] + } + ], + "env": [], + "meta": {}, + "color": "#DDAA99" + }, { "id": "e3876559.c845b8", "type": "tls-config", @@ -194,16 +234,6 @@ "disabled": false, "hidden": false }, - { - "id": "3cc11d24.ff01a2", - "type": "comment", - "z": "f6f2187d.f17ca8", - "name": "WARNING: please check you have started this container with a volume that is mounted to /data\\n otherwise any flow changes are lost when you redeploy or upgrade the container\\n (e.g. upgrade to a more recent node-red docker image).\\n If you are using named volumes you can ignore this warning.\\n Double click or see info side panel to learn how to start Node-RED in Docker to save your work", - "info": "\nTo start docker with a bind mount volume (-v option), for example:\n\n```\ndocker run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red\n```\n\nwhere `/home/user/node_red_data` is a directory on your host machine where you want to store your flows.\n\nIf you do not do this then you can experiment and redploy flows, but if you restart or upgrade the container the flows will be disconnected and lost. \n\nThey will still exist in a hidden data volume, which can be recovered using standard docker techniques, but that is much more complex than just starting with a named volume as described above.", - "x": 350, - "y": 80, - "wires": [] - }, { "id": "4c001d43.2cc414", "type": "template", @@ -4404,7 +4434,7 @@ "t": "set", "p": "payload", "pt": "msg", - "to": "{\"from\":\"Gregory \",\"to\":\"labs@mg.brunoamaral.net\",\"subject\":\"Gregory Admin Summary\",\"multipart\":true}", + "to": "{\"from\":\"Gregory \",\"to\":\"labs@mg.brunoamaral.net\",\"subject\":\"Gregory Admin Summary\",\"multipart\":true}", "tot": "json" }, { @@ -4509,7 +4539,7 @@ "t": "set", "p": "payload", "pt": "msg", - "to": "{\"from\":\"Gregory \",\"to\":\"subscribers@mg.brunoamaral.net\",\"subject\":\"Gregory Weekly Summary\",\"multipart\":true}", + "to": "{\"from\":\"Gregory \",\"to\":\"subscribers@mg.brunoamaral.net\",\"subject\":\"Gregory Weekly Summary\",\"multipart\":true}", "tot": "json" }, { @@ -5023,7 +5053,7 @@ "from": "", "to": "", "reg": false, - "x": 580, + "x": 660, "y": 240, "wires": [ [ @@ -5050,7 +5080,7 @@ "from": "", "to": "", "reg": false, - "x": 580, + "x": 660, "y": 360, "wires": [ [ @@ -5071,7 +5101,7 @@ "y": 200, "wires": [ [ - "b066e85a9e026e20" + "8954a956a44acfb2" ] ] }, @@ -5088,7 +5118,7 @@ "y": 240, "wires": [ [ - "08843a43c7cc19c1" + "6bcbd03003145a20" ] ] }, @@ -5105,7 +5135,7 @@ "y": 320, "wires": [ [ - "86c6a848cc148a02" + "5afac07baef3483b" ] ] }, @@ -5122,7 +5152,7 @@ "y": 360, "wires": [ [ - "2de42969e58fa460" + "a40c7340e5fbfef8" ] ] }, @@ -5139,7 +5169,7 @@ "y": 400, "wires": [ [ - "bb53f6d7480dc232" + "085ae9ab41f9cf6b" ] ] }, @@ -5162,7 +5192,7 @@ "from": "", "to": "", "reg": false, - "x": 580, + "x": 660, "y": 280, "wires": [ [ @@ -5183,7 +5213,7 @@ "y": 280, "wires": [ [ - "bf720f2e31bd565f" + "76665e8c2a91cfae" ] ] }, @@ -5195,7 +5225,7 @@ "sqlquery": "msg.topic", "sql": "", "name": "", - "x": 930, + "x": 1190, "y": 320, "wires": [ [ @@ -5211,7 +5241,7 @@ "property": "payload", "action": "", "pretty": false, - "x": 1110, + "x": 1370, "y": 320, "wires": [ [ @@ -5245,7 +5275,7 @@ "from": "", "to": "", "reg": false, - "x": 1250, + "x": 1510, "y": 320, "wires": [ [ @@ -5260,7 +5290,7 @@ "name": "", "statusCode": "", "headers": {}, - "x": 1390, + "x": 1650, "y": 320, "wires": [] }, @@ -5277,8 +5307,8 @@ "y": 620, "wires": [ [ - "cb73fef320f86a0a", - "41120e6782e2a5f8" + "9880d8bf6a202db7", + "ef627abb865f90b4" ] ] }, @@ -5295,7 +5325,7 @@ "y": 540, "wires": [ [ - "878646332f28d3d3" + "672dae26ade75533" ] ] }, @@ -5422,7 +5452,9 @@ "x": 1270, "y": 660, "wires": [ - [] + [ + "1e1ffb8d77abbde8" + ] ] }, { @@ -5454,7 +5486,7 @@ "rateUnits": "minute", "randomFirst": "12", "randomLast": "15", - "randomUnits": "hours", + "randomUnits": "seconds", "drop": false, "allowrate": false, "x": 860, @@ -5478,7 +5510,7 @@ "y": 440, "wires": [ [ - "dc5687c51e9fecfa" + "a5a1bd7a98d4a993" ] ] }, @@ -5501,7 +5533,7 @@ "from": "", "to": "", "reg": false, - "x": 580, + "x": 660, "y": 440, "wires": [ [ @@ -5522,7 +5554,7 @@ "y": 480, "wires": [ [ - "3d88dfe4df13ea2d" + "33711c0523948df7" ] ] }, @@ -5545,7 +5577,7 @@ "from": "", "to": "", "reg": false, - "x": 580, + "x": 660, "y": 480, "wires": [ [ @@ -5566,7 +5598,7 @@ "y": 780, "wires": [ [ - "af3f3488f9807b0a" + "e75c16ed3a2a8728" ] ] }, @@ -5578,7 +5610,7 @@ "query": "SELECT\n\t*\nFROM\n\tarticles\nWHERE\n\ttitle LIKE (?);", "vars": "keyword", "outField": "topic", - "x": 510, + "x": 790, "y": 780, "wires": [ [ @@ -5594,7 +5626,7 @@ "sqlquery": "msg.topic", "sql": "", "name": "", - "x": 730, + "x": 1010, "y": 820, "wires": [ [ @@ -5621,7 +5653,7 @@ "from": "", "to": "", "reg": false, - "x": 370, + "x": 650, "y": 780, "wires": [ [ @@ -5642,7 +5674,7 @@ "y": 840, "wires": [ [ - "4475037a98e468ec" + "1ba768c6f5c4ce02" ] ] }, @@ -5665,7 +5697,7 @@ "from": "", "to": "", "reg": false, - "x": 370, + "x": 650, "y": 840, "wires": [ [ @@ -5681,7 +5713,7 @@ "query": "SELECT\n\t*\nFROM\n\ttrials\nWHERE\n\ttitle LIKE (?);", "vars": "keyword", "outField": "topic", - "x": 510, + "x": 790, "y": 840, "wires": [ [ @@ -5702,95 +5734,7 @@ "y": 900, "wires": [ [ - "cdbd05862cd8c88e" - ] - ] - }, - { - "id": "2edfa449a679e171", - "type": "http request", - "z": "ed1d968f509a241a", - "name": "", - "method": "POST", - "ret": "txt", - "paytoqs": "body", - "url": "https://api.brunoamaral.net/articles/related/", - "tls": "e3876559.c845b8", - "persist": false, - "proxy": "", - "authType": "", - "x": 250, - "y": 1200, - "wires": [ - [ - "fe8eeb3d8fe45570" - ] - ] - }, - { - "id": "10c19e28eee52ded", - "type": "inject", - "z": "ed1d968f509a241a", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "{\"keywords\":[\"mTOR\",\"Regulates Metabolic Function\",\"Oligodendrocyte Precursor Cells\",\"Promotes Efficient Brain Remyelination\",\"the Cuprizone Model\"]}", - "payloadType": "str", - "x": 100, - "y": 1200, - "wires": [ - [ - "2edfa449a679e171" - ] - ] - }, - { - "id": "7e1b0e11c22af05a", - "type": "http response", - "z": "ed1d968f509a241a", - "name": "", - "statusCode": "", - "headers": {}, - "x": 570, - "y": 1200, - "wires": [] - }, - { - "id": "fe8eeb3d8fe45570", - "type": "change", - "z": "ed1d968f509a241a", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "ok", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 420, - "y": 1200, - "wires": [ - [ - "7e1b0e11c22af05a" + "999e2deb414d9ce8" ] ] }, @@ -5802,7 +5746,7 @@ "query": "SELECT * FROM articles where article_id = ? ORDER BY article_id DESC;", "vars": "req.params.id", "outField": "topic", - "x": 610, + "x": 690, "y": 200, "wires": [ [ @@ -5818,7 +5762,7 @@ "query": "SELECT * FROM articles where source = ? ORDER BY article_id DESC;", "vars": "req.params.source", "outField": "topic", - "x": 610, + "x": 690, "y": 320, "wires": [ [ @@ -5834,7 +5778,7 @@ "query": "SELECT * FROM articles WHERE discovery_date LIKE ? ORDER BY article_id DESC;", "vars": "date", "outField": "topic", - "x": 610, + "x": 770, "y": 400, "wires": [ [ @@ -5861,7 +5805,7 @@ "from": "", "to": "", "reg": false, - "x": 480, + "x": 640, "y": 400, "wires": [ [ @@ -5877,7 +5821,7 @@ "query": "UPDATE articles\nSET relevant = \"0\"\nWHERE article_id = ?;", "vars": "req.params.id", "outField": "topic", - "x": 430, + "x": 530, "y": 540, "wires": [ [ @@ -5893,7 +5837,7 @@ "query": "UPDATE articles\nSET relevant = \"1\"\nWHERE article_id = ?;", "vars": "req.params.id", "outField": "topic", - "x": 430, + "x": 530, "y": 600, "wires": [ [ @@ -5909,7 +5853,7 @@ "query": "SELECT * FROM articles where article_id = ? ORDER BY article_id DESC;", "vars": "req.params.id", "outField": "topic", - "x": 430, + "x": 530, "y": 660, "wires": [ [ @@ -5928,7 +5872,7 @@ "syntax": "mustache", "template": "select * from articles\nwhere\n(title = \"\")\n{{#keywords}}\nOR (title like \"%{{.}}%\")\n{{/keywords}}\n;", "output": "str", - "x": 510, + "x": 790, "y": 900, "wires": [ [ @@ -5936,35 +5880,6 @@ ] ] }, - { - "id": "a4ee3e434e6d3499", - "type": "inject", - "z": "ed1d968f509a241a", - "name": "", - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "{\"keywords\":[\"mTOR\",\"Regulates Metabolic Function\",\"Oligodendrocyte Precursor Cells\",\"Promotes Efficient Brain Remyelination\",\"the Cuprizone Model\"]}", - "payloadType": "json", - "x": 90, - "y": 1140, - "wires": [ - [ - "2edfa449a679e171" - ] - ] - }, { "id": "cdbd05862cd8c88e", "type": "function", @@ -5976,7 +5891,7 @@ "initialize": "", "finalize": "", "libs": [], - "x": 360, + "x": 640, "y": 900, "wires": [ [ @@ -5991,7 +5906,7 @@ "name": "", "statusCode": "", "headers": {}, - "x": 1190, + "x": 1470, "y": 820, "wires": [] }, @@ -6003,7 +5918,7 @@ "property": "payload", "action": "", "pretty": false, - "x": 890, + "x": 1170, "y": 820, "wires": [ [ @@ -6037,7 +5952,7 @@ "from": "", "to": "", "reg": false, - "x": 1030, + "x": 1310, "y": 820, "wires": [ [ @@ -6058,7 +5973,7 @@ "y": 100, "wires": [ [ - "681914b9361e091e" + "9b9e5f001768e6b3" ] ] }, @@ -6126,7 +6041,7 @@ "fieldType": "msg", "format": "handlebars", "syntax": "mustache", - "template": "Please visit https://gregory-ms.com", + "template": "

Please visit https://gregory-ms.com

", "output": "str", "x": 340, "y": 60, @@ -6135,5 +6050,1154 @@ "a4333998a0213cbc" ] ] + }, + { + "id": "70b6e3e4a833d450", + "type": "inject", + "z": "3645fb833bf0fede", + "name": "", + "props": [ + { + "p": "payload" + } + ], + "repeat": "1200", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "https://api.gregory-ms.com/articles/prediction/none", + "payloadType": "str", + "x": 90, + "y": 180, + "wires": [ + [ + "147fc09265d87c6d" + ] + ] + }, + { + "id": "342bd369d2e46572", + "type": "json", + "z": "3645fb833bf0fede", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 630, + "y": 180, + "wires": [ + [ + "076aeb0139c0cbfd" + ] + ] + }, + { + "id": "1984f34ca59fb1ec", + "type": "sqlite", + "z": "3645fb833bf0fede", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "", + "x": 670, + "y": 80, + "wires": [ + [ + "7bb82dec22cc7b9d" + ] + ] + }, + { + "id": "7d35621d66992c95", + "type": "http in", + "z": "3645fb833bf0fede", + "name": "", + "url": "/articles/prediction/none", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 140, + "y": 80, + "wires": [ + [ + "c033cc4b1874ff5c" + ] + ] + }, + { + "id": "c033cc4b1874ff5c", + "type": "change", + "z": "3645fb833bf0fede", + "name": "get articles with no prediction", + "rules": [ + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "select * from articles where ml_prediction_gnb is null OR ml_prediction_lr is null OR ml_prediction_gnb = '' OR ml_prediction_lr = '' ;", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 410, + "y": 80, + "wires": [ + [ + "1984f34ca59fb1ec" + ] + ] + }, + { + "id": "31d9cd8cc41435ee", + "type": "http response", + "z": "3645fb833bf0fede", + "name": "", + "statusCode": "", + "headers": {}, + "x": 950, + "y": 80, + "wires": [] + }, + { + "id": "7bb82dec22cc7b9d", + "type": "json", + "z": "3645fb833bf0fede", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 830, + "y": 80, + "wires": [ + [ + "31d9cd8cc41435ee" + ] + ] + }, + { + "id": "076aeb0139c0cbfd", + "type": "template", + "z": "3645fb833bf0fede", + "name": "", + "field": "topic", + "fieldType": "msg", + "format": "sql", + "syntax": "mustache", + "template": "{{#payload.models.gnb}}\nUPDATE articles SET ml_prediction_gnb = {{prediction}} WHERE article_id = {{article_id}};\n{{/payload.models.gnb}}\n\n{{#payload.models.lr}}\nUPDATE articles SET ml_prediction_lr = {{prediction}} WHERE article_id = {{article_id}};\n{{/payload.models.lr}}", + "output": "str", + "x": 820, + "y": 180, + "wires": [ + [ + "3dbb2d48968a27a1" + ] + ] + }, + { + "id": "147fc09265d87c6d", + "type": "exec", + "z": "3645fb833bf0fede", + "command": "/usr/bin/python3 /python-ml/3_predict.py ", + "addpay": "payload", + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "", + "x": 360, + "y": 180, + "wires": [ + [ + "342bd369d2e46572" + ], + [], + [] + ] + }, + { + "id": "87115a20c1c2cf99", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/gregory/crud", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 270, + "y": 200, + "wires": [ + [ + "66e44c034ef2ef26" + ] + ] + }, + { + "id": "fc34c29fb99e7989", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "statusCode": "", + "headers": {}, + "x": 1220, + "y": 200, + "wires": [] + }, + { + "id": "b00f84561ffb733a", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/search", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 250, + "y": 320, + "wires": [ + [ + "04353f99a1069a9b", + "402978af07b91f0b" + ] + ] + }, + { + "id": "04353f99a1069a9b", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "search-query", + "func": "msg.topic=\"select article_id, discovery_date, title, summary, link, published_date, source, relevant, ml_prediction_lr,ml_prediction_gnb, sent from articles ORDER BY article_id desc\";\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 490, + "y": 320, + "wires": [ + [ + "f744f26b37f36a46", + "0a5f1e358aaf2c6a" + ] + ] + }, + { + "id": "f4ecdbcb802e308e", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "statusCode": "", + "headers": {}, + "x": 1230, + "y": 320, + "wires": [] + }, + { + "id": "5e59d8fa2752e970", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "search-response", + "func": "return msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "x": 885, + "y": 320, + "wires": [ + [ + "912b76475830da4a", + "f4ecdbcb802e308e" + ] + ] + }, + { + "id": "4244430e6c810183", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/insert", + "method": "post", + "upload": false, + "swaggerDoc": "", + "x": 250, + "y": 525, + "wires": [ + [ + "0796222b8323caf0", + "7e2472cb7c275402" + ] + ] + }, + { + "id": "a2555ea476373741", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "insert-response", + "func": "msg.payload=msg.result;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 875, + "y": 525, + "wires": [ + [ + "7e3aa65b45f2ae52" + ] + ] + }, + { + "id": "0796222b8323caf0", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "insert-query", + "func": "msg.topic=\"INSERT INTO articles (discovery_date,link,published_date,relevant,source,summary,title) VALUES ('\" + msg.payload.discovery_date + \"','\" + msg.payload.link + \"','\" + msg.payload.published_date + \"','\" + msg.payload.relevant + \"','\" + msg.payload.source + \"','\" + msg.payload.summary + \"','\" + msg.payload.title + \"');\"\nreturn msg;\n", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "x": 490, + "y": 525, + "wires": [ + [ + "5ca303ce2df4958f", + "e8d1f32c7a7249e8" + ] + ] + }, + { + "id": "7e3aa65b45f2ae52", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "x": 1220, + "y": 525, + "wires": [] + }, + { + "id": "25e521fd09e329e0", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "lastname-query", + "func": "msg.topic=\"SELECT article_id, title as value FROM articles\";\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "x": 500, + "y": 420, + "wires": [ + [ + "800e1f13f846157a" + ] + ] + }, + { + "id": "e8104c57db23c57d", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "lastname-response", + "func": "return msg;", + "outputs": 1, + "noerr": 0, + "x": 885, + "y": 420, + "wires": [ + [ + "24db2a5350d0af26", + "8a948f4cad0df6ac" + ] + ] + }, + { + "id": "5cbbbe5cf566f1b3", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/search/prijmeni", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 270, + "y": 440, + "wires": [ + [ + "25e521fd09e329e0", + "99f7f3e9fea11a82" + ] + ] + }, + { + "id": "24db2a5350d0af26", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "statusCode": "", + "headers": {}, + "x": 1220, + "y": 420, + "wires": [] + }, + { + "id": "a7bf8a58bb2c9827", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/delete", + "method": "post", + "upload": false, + "swaggerDoc": "", + "x": 250, + "y": 800, + "wires": [ + [ + "b33ef94bf85452a0", + "cdb10d89fb6efbec" + ] + ] + }, + { + "id": "68967d7e44cf8d7c", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "delete-response", + "func": "msg.payload=msg.result;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 875, + "y": 800, + "wires": [ + [ + "ad13e04697ff461d" + ] + ] + }, + { + "id": "b33ef94bf85452a0", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "delete-query", + "func": "msg.topic=\"DELETE FROM articles WHERE article_id='\" + msg.payload.id + \"'\";\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "x": 490, + "y": 800, + "wires": [ + [ + "3f4d2ed459313b9c", + "e46a5949cc52847c" + ] + ] + }, + { + "id": "ad13e04697ff461d", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "x": 1220, + "y": 800, + "wires": [] + }, + { + "id": "ca94f475a8197f86", + "type": "http in", + "z": "9297a3d188e4e9d4", + "name": "", + "url": "/update", + "method": "post", + "upload": false, + "swaggerDoc": "", + "x": 250, + "y": 695, + "wires": [ + [ + "1ebd221ec50c3406" + ] + ] + }, + { + "id": "c40b6669579edff4", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "update-response", + "func": "msg.payload=msg.result;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 995, + "y": 695, + "wires": [ + [ + "f553d93e8e287a57", + "a708a0e3f89b5d35" + ] + ] + }, + { + "id": "ca8e2ee51918d82d", + "type": "function", + "z": "9297a3d188e4e9d4", + "name": "update-query", + "func": "msg.topic=\"UPDATE articles SET discovery_date = '\" + msg.payload.discovery_date + \"', link = '\" + msg.payload.link + \"', published_date = '\" + msg.payload.published_date + \"', relevant = '\" + msg.payload.relevant + \"', source = '\" + msg.payload.source + \"', summary = '\" + msg.payload.summary + \"', title ='\" + msg.payload.title + \"', sent = '\" + msg.payload.sent +\"' WHERE article_id='\" + msg.payload.article_id + \"';\";\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 600, + "y": 680, + "wires": [ + [ + "6a4e1ad79bb6d972", + "69123a8ae21c34ce" + ] + ] + }, + { + "id": "f553d93e8e287a57", + "type": "http response", + "z": "9297a3d188e4e9d4", + "name": "", + "x": 1330, + "y": 695, + "wires": [] + }, + { + "id": "f744f26b37f36a46", + "type": "sqlite", + "z": "9297a3d188e4e9d4", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "wtest", + "x": 670, + "y": 300, + "wires": [ + [ + "5e59d8fa2752e970", + "e89c32d96669ac43" + ] + ] + }, + { + "id": "800e1f13f846157a", + "type": "sqlite", + "z": "9297a3d188e4e9d4", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "wtest", + "x": 670, + "y": 420, + "wires": [ + [ + "e8104c57db23c57d" + ] + ] + }, + { + "id": "5ca303ce2df4958f", + "type": "sqlite", + "z": "9297a3d188e4e9d4", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "wtest", + "x": 670, + "y": 525, + "wires": [ + [ + "a2555ea476373741" + ] + ] + }, + { + "id": "6a4e1ad79bb6d972", + "type": "sqlite", + "z": "9297a3d188e4e9d4", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "wtest", + "x": 780, + "y": 695, + "wires": [ + [ + "c40b6669579edff4", + "e9f2ee41f30e5c0d" + ] + ] + }, + { + "id": "3f4d2ed459313b9c", + "type": "sqlite", + "z": "9297a3d188e4e9d4", + "mydb": "9ccc1658.e12858", + "sqlquery": "msg.topic", + "sql": "", + "name": "wtest", + "x": 670, + "y": 800, + "wires": [ + [ + "68967d7e44cf8d7c", + "f3d51440186bae4f" + ] + ] + }, + { + "id": "912b76475830da4a", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1110, + "y": 240, + "wires": [] + }, + { + "id": "0a5f1e358aaf2c6a", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 690, + "y": 380, + "wires": [] + }, + { + "id": "99f7f3e9fea11a82", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 490, + "y": 460, + "wires": [] + }, + { + "id": "7e2472cb7c275402", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 487, + "y": 571, + "wires": [] + }, + { + "id": "1ebd221ec50c3406", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 490, + "y": 746, + "wires": [] + }, + { + "id": "402978af07b91f0b", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 320, + "y": 380, + "wires": [] + }, + { + "id": "cdb10d89fb6efbec", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 490, + "y": 886, + "wires": [] + }, + { + "id": "e46a5949cc52847c", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 730, + "y": 886, + "wires": [] + }, + { + "id": "f3d51440186bae4f", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 980, + "y": 886, + "wires": [] + }, + { + "id": "8a948f4cad0df6ac", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1230, + "y": 460, + "wires": [] + }, + { + "id": "e89c32d96669ac43", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 850, + "y": 240, + "wires": [] + }, + { + "id": "e8d1f32c7a7249e8", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 690, + "y": 580, + "wires": [] + }, + { + "id": "69123a8ae21c34ce", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "topic", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 790, + "y": 640, + "wires": [] + }, + { + "id": "66e44c034ef2ef26", + "type": "template", + "z": "9297a3d188e4e9d4", + "name": "web-template", + "field": "payload", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n CRUD with jqGrid\n \n \n \n \n
\n
\n \n \n", + "x": 500, + "y": 200, + "wires": [ + [ + "fc34c29fb99e7989" + ] + ] + }, + { + "id": "534507c76ba74f39", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 690, + "y": 760, + "wires": [] + }, + { + "id": "a708a0e3f89b5d35", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1200, + "y": 640, + "wires": [] + }, + { + "id": "e9f2ee41f30e5c0d", + "type": "debug", + "z": "9297a3d188e4e9d4", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1000, + "y": 640, + "wires": [] + }, + { + "id": "3dbb2d48968a27a1", + "type": "sqlite", + "z": "3645fb833bf0fede", + "mydb": "9ccc1658.e12858", + "sqlquery": "batch", + "sql": "", + "name": "", + "x": 1010, + "y": 180, + "wires": [ + [] + ] + }, + { + "id": "4a161b1010e3b2de", + "type": "debug", + "z": "ed1d968f509a241a", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 1450, + "y": 500, + "wires": [] + }, + { + "id": "1e1ffb8d77abbde8", + "type": "json", + "z": "ed1d968f509a241a", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 1370, + "y": 580, + "wires": [ + [ + "4a161b1010e3b2de" + ] + ] + }, + { + "id": "d5716d48a6a85ee3", + "type": "delay", + "z": "d353eec5835441c0", + "name": "", + "pauseType": "rate", + "timeout": "500", + "timeoutUnits": "milliseconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": true, + "x": 490, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "9b9e5f001768e6b3", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 400, + "y": 100, + "wires": [ + [ + "681914b9361e091e" + ] + ] + }, + { + "id": "eb444d3ffa4f324c", + "type": "change", + "z": "d353eec5835441c0", + "name": "", + "rules": [ + { + "t": "set", + "p": "rate", + "pt": "msg", + "to": "200", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 320, + "y": 160, + "wires": [ + [ + "d5716d48a6a85ee3" + ] + ] + }, + { + "id": "8954a956a44acfb2", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 200, + "wires": [ + [ + "b066e85a9e026e20" + ] + ] + }, + { + "id": "6bcbd03003145a20", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 240, + "wires": [ + [ + "08843a43c7cc19c1" + ] + ] + }, + { + "id": "76665e8c2a91cfae", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 280, + "wires": [ + [ + "bf720f2e31bd565f" + ] + ] + }, + { + "id": "5afac07baef3483b", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 320, + "wires": [ + [ + "86c6a848cc148a02" + ] + ] + }, + { + "id": "a40c7340e5fbfef8", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 360, + "wires": [ + [ + "2de42969e58fa460" + ] + ] + }, + { + "id": "085ae9ab41f9cf6b", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 400, + "wires": [ + [ + "bb53f6d7480dc232" + ] + ] + }, + { + "id": "a5a1bd7a98d4a993", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 440, + "wires": [ + [ + "dc5687c51e9fecfa" + ] + ] + }, + { + "id": "33711c0523948df7", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 480, + "wires": [ + [ + "3d88dfe4df13ea2d" + ] + ] + }, + { + "id": "672dae26ade75533", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 540, + "wires": [ + [ + "878646332f28d3d3" + ] + ] + }, + { + "id": "9880d8bf6a202db7", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 600, + "wires": [ + [ + "cb73fef320f86a0a" + ] + ] + }, + { + "id": "ef627abb865f90b4", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 660, + "wires": [ + [ + "41120e6782e2a5f8" + ] + ] + }, + { + "id": "e75c16ed3a2a8728", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 780, + "wires": [ + [ + "af3f3488f9807b0a" + ] + ] + }, + { + "id": "1ba768c6f5c4ce02", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 380, + "y": 840, + "wires": [ + [ + "4475037a98e468ec" + ] + ] + }, + { + "id": "999e2deb414d9ce8", + "type": "subflow:d353eec5835441c0", + "z": "ed1d968f509a241a", + "name": "throttle requests", + "env": [], + "x": 320, + "y": 900, + "wires": [ + [ + "cdbd05862cd8c88e" + ] + ] } ] \ No newline at end of file