www.destandaard.be Nieuws
Small flow to push news from the De Standaard. A random feed (every 1 min) from a pull every 30 min.
Node-RED
AWTRIX 3
About this flow
| System | Node-RED |
|---|---|
| AWTRIX version | AWTRIX 3 |
| Topic | News |
| Built by | Tomasino Le Grand |
| File | XjzB5yLeOQl7.json · 5.2 KB |
| Icons | 1 |
| Published | 22 Dec 2023 · updated 22 Dec 2023 |
| Downloads | 40 |
Is this your flow?
If you created this flow, open your saved edit link to add it to your account. You can then manage it whenever you sign in. Adding it to your account replaces the edit link.
Can be configured to use different rss feed
XjzB5yLeOQl7.json
[{"id":"f9df73f7bf596a4b","type":"tab","label":"www.standaard.be","disabled":false,"info":"","env":[]},{"id":"be824c1825727279","type":"group","z":"f9df73f7bf596a4b","name":"App: www.standaard.be","style":{"label":true,"stroke":"#bfdbef","fill":"#ffbfbf","fill-opacity":"0.48"},"nodes":["76fa53d27b8baf07","0a3e9004228428b2","d4c4975e4e2a4cf0","ac812e901961f024","5a9bbd36ef312e46","eb72bdeff2a58658","b39d92cc53e213d4","eff93403b68ab780","2b831bafc1a036a4","7c42c7f2320bf670","89c2dff8248821e1"],"x":74,"y":79,"w":1472,"h":202},{"id":"0a3e9004228428b2","type":"http request","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Get News RSS Feed","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.standaard.be/rss/section/1f2838d4-99ea-49f0-9102-138784c7ea7c","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":480,"y":120,"wires":[["d4c4975e4e2a4cf0"]]},{"id":"d4c4975e4e2a4cf0","type":"xml","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Convert XML to JSON","property":"payload","attr":"","chr":"","x":740,"y":120,"wires":[["eb72bdeff2a58658"]]},{"id":"ac812e901961f024","type":"change","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Set style, Topic and Payload","rules":[{"t":"set","p":"style","pt":"msg","to":"is-success","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"feed.rss.channel[0].title[0]","tot":"flow"},{"t":"set","p":"payload","pt":"msg","to":"feed.rss.channel[0].item","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":180,"wires":[["b39d92cc53e213d4"]]},{"id":"5a9bbd36ef312e46","type":"inject","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":true,"onceDelay":"1","topic":"Every 30 Minutes","payload":"true","payloadType":"bool","x":220,"y":120,"wires":[["0a3e9004228428b2"]]},{"id":"eb72bdeff2a58658","type":"change","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Store in flow.feed","rules":[{"t":"move","p":"payload","pt":"msg","to":"feed","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":120,"wires":[[]]},{"id":"b39d92cc53e213d4","type":"function","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Pick Random Item","func":"var length = msg.payload.length\nvar random = Math.floor(Math.random() * length);\n\nmsg.random = random\nmsg.payload = msg.payload[random]\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":180,"wires":[["7c42c7f2320bf670"]]},{"id":"eff93403b68ab780","type":"ui_button","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"","group":"edc69b174e90b36d","order":3,"width":0,"height":0,"passthru":false,"label":"UPDATE NEWS","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":260,"y":240,"wires":[["ac812e901961f024"]]},{"id":"2b831bafc1a036a4","type":"inject","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"Every minute random from feed","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":180,"wires":[["ac812e901961f024"]]},{"id":"76fa53d27b8baf07","type":"mqtt out","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"add/update custom app News using MQTT","topic":"awtrix_bijloke/custom/RSS","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"3e1d2b1235eba75a","x":1350,"y":180,"wires":[]},{"id":"7c42c7f2320bf670","type":"function","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"create RSS Feed","func":"//const text = msg.text;\nconst text = msg.payload.description[0];\nconst text1 = text.replace(\"<p>\", \"\");\nconst text2 = text1.replace(\"</p>\", \"\");\nconst icon = \"ds\";\nconst duration = 20;\nconst rainbow = true;\nconst pushIcon = 2;\nmsg.payload = { \"text\": text2, \"icon\": icon, \"duration\": duration, \"pushIcon\": pushIcon, \"rainbow\": rainbow};\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1030,"y":180,"wires":[["76fa53d27b8baf07","89c2dff8248821e1"]]},{"id":"89c2dff8248821e1","type":"debug","z":"f9df73f7bf596a4b","g":"be824c1825727279","name":"debug news","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1250,"y":240,"wires":[]},{"id":"edc69b174e90b36d","type":"ui_group","name":"NEWS","tab":"57be6251cfa8956c","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"3e1d2b1235eba75a","type":"mqtt-broker","name":"192.168.1.13:1883","broker":"192.168.1.13","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"57be6251cfa8956c","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
This flow uses the following icons. Add them to your AWTRIX along with the flow.
8×8 px