Wer die Covid-19 Daten per Twitter als Online-Ticker für Deutschland haben will, kann mit dem Raspberry Pi und Node-RED den folgender Flow verwenden. Es werden jede Stunde die aktuellen Werte abgefragt, und bei Änderung per Twitter versendet. Hier der nötige Flow:
So sieht der Twitter Eintrag aus, er kann auch für alle Länder angepasst werden:
Hier der nötige Quellcode:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
[ { "id": "622e582b.b2261", "type": "comment", "z": "884ebfce.72d028", "name": "www.wenzlaff.info", "info": "", "x": 630, "y": 500, "wires": [] }, { "id": "8c6d68f.1965618", "type": "inject", "z": "884ebfce.72d028", "name": "Jede Stunde", "topic": "", "payload": "", "payloadType": "date", "repeat": "3600", "crontab": "", "once": false, "onceDelay": 0.1, "x": 140, "y": 540, "wires": [ [ "3198308f.b1d0b" ] ] }, { "id": "3198308f.b1d0b", "type": "http request", "z": "884ebfce.72d028", "name": "Covid-19 abfragen für Deutschland", "method": "GET", "ret": "obj", "paytoqs": false, "url": "https://covid19.mathdro.id/api/confirmed", "tls": "", "persist": false, "proxy": "", "authType": "basic", "x": 280, "y": 600, "wires": [ [ "85336713.7e3e5" ] ] }, { "id": "85336713.7e3e5", "type": "function", "z": "884ebfce.72d028", "name": "Covid-19 Deutschland Meldung", "func": "var nachricht = \"Bestätigte Personen mit covid-19 in Deutschland: \" + msg.payload[8].confirmed + \n\" Genesen: \" + + msg.payload[8].recovered + \n\" Gestorben: \" + + msg.payload[8].deaths +\n\" - #covid19 #coronavirus #corona #coronavirusdeutschland #covid #virus #deutschland\";\n\nmsg.payload = nachricht;\nmsg.topic = nachricht;\n\nreturn msg;\n", "outputs": 1, "noerr": 0, "x": 310, "y": 660, "wires": [ [ "a29a5d6.a71512" ] ] }, { "id": "a29a5d6.a71512", "type": "rbe", "z": "884ebfce.72d028", "name": "Nur bei Änderung des Wert weiter", "func": "rbe", "gap": "", "start": "", "inout": "out", "property": "payload", "x": 400, "y": 720, "wires": [ [ "edf4f959.998a88", "c7aea8a5.ed7d38" ] ] }, { "id": "edf4f959.998a88", "type": "debug", "z": "884ebfce.72d028", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 690, "y": 720, "wires": [] }, { "id": "c7aea8a5.ed7d38", "type": "twitter out", "z": "884ebfce.72d028", "twitter": "", "name": "Tweet", "x": 670, "y": 780, "wires": [] }, { "id": "71ae5876.b57de8", "type": "comment", "z": "884ebfce.72d028", "name": "via Service von https://covid19.mathdro.id/api/confirmed", "info": "", "x": 750, "y": 600, "wires": [] }, { "id": "8e007bf2.5451c8", "type": "comment", "z": "884ebfce.72d028", "name": "covid-19 Live-Ticker für Deutschland", "info": "", "x": 180, "y": 500, "wires": [] } ] |