forked from Kater--S/MarQueTT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node-RED-flow_Twitter.json
1 lines (1 loc) · 1.86 KB
/
Node-RED-flow_Twitter.json
1
[{"id":"3c9496b4.0e9b52","type":"twitter in","z":"cebedba3.f3ea28","twitter":"","tags":"c3re,ccc","user":"false","name":"","inputs":0,"x":250,"y":240,"wires":[["b786985a.2de1c8"]]},{"id":"83d2545.c0da9a8","type":"function","z":"cebedba3.f3ea28","name":"assemble tweet","func":"msg.topic = \"1\";\ntext = `+++[${msg.topic}]+++ `.concat(\"Twitter\").concat(\" @\");\ntext = text.concat(msg.tweet.user.screen_name).concat(\" +++ \")\n\npl = msg.payload;\nvar n = pl.indexOf(\"https://t.co\");\nif (n != -1) {\n pl = pl.substr(0,n-1);\n}\n\ntext = text.concat(pl).concat(\" +++ \")\n\nmsg ={\n \"topic\": `ledMatrix/all/text/${msg.topic}`,\n \"payload\": text\n };\n\nreturn msg;\n","outputs":1,"noerr":0,"x":420,"y":320,"wires":[["8812f682.320e38"]]},{"id":"142108d7.2e3f2f","type":"delay","z":"cebedba3.f3ea28","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":450,"y":280,"wires":[["83d2545.c0da9a8"]]},{"id":"b786985a.2de1c8","type":"function","z":"cebedba3.f3ea28","name":"filter EN/DE","func":"\n//if (msg.lang == \"en\") return msg;\nif (msg.lang == \"de\") return msg;\nreturn null;\n","outputs":1,"noerr":0,"x":410,"y":240,"wires":[["142108d7.2e3f2f"]]},{"id":"8812f682.320e38","type":"mqtt out","z":"cebedba3.f3ea28","name":"→ c3RE","topic":"","qos":"","retain":"","broker":"1fc8a953.00a93f","x":660,"y":320,"wires":[]},{"id":"1fc8a953.00a93f","type":"mqtt-broker","z":"","name":"kater @ c3RE","broker":"mqtt.c3re.de","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]