Twitter Sentimentometer (Visual gauge of sentiment on a subject)

Display a gauge of twitter sentiment (neutral in the middle, negative to the left and positive to the right). Set the subject to look for in tweets from the twitter streaming node. Twitter developer account needed (or you can connect the standard twitter node and just get less data)

[{"id":"2d6fd3a9.cee9d4","type":"sentiment","z":"3a937b2a.42833c","name":"","x":341.2143211364746,"y":292.0000066757202,"wires":[["ac173408.8c6ba"]]},{"id":"8c815212.e16f2","type":"smooth","z":"3a937b2a.42833c","name":"","action":"mean","count":"100","round":"","x":717.7857322692871,"y":363.8571615219116,"wires":[["53da15b4.9f4534"]]},{"id":"41810814.2407b","type":"ui_gauge","z":"3a937b2a.42833c","name":"Sentiment","group":"45c0950c.78e094","order":0,"width":0,"height":0,"gtype":"gage","title":"Twitter Result","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#CA3838","#FFFFFF","#00B500#"],"seg1":"","seg2":"","x":1235.5,"y":364.2857036590576,"wires":[]},{"id":"92afeab9.f79d18","type":"debug","z":"3a937b2a.42833c","name":"","active":false,"console":"false","complete":"true","x":527.9285888671875,"y":233.28571033477783,"wires":[]},{"id":"ac173408.8c6ba","type":"function","z":"3a937b2a.42833c","name":"Send sentiment as payload","func":"msg.payload = msg.sentiment.score;\nreturn msg;","outputs":1,"noerr":0,"x":578.4999732971191,"y":293.4286003112793,"wires":[["8c815212.e16f2"]]},{"id":"53da15b4.9f4534","type":"range","z":"3a937b2a.42833c","minin":"-5","maxin":"5","minout":"0","maxout":"10","action":"scale","round":false,"name":"","x":861.9286041259766,"y":362.000018119812,"wires":[["28147bf6.07e24c"]]},{"id":"3db8694a.a2be76","type":"Twitter Topics","z":"3a937b2a.42833c","connection":"f6cd35cc.199d2","topics":" brexit","x":142.21429824829102,"y":166.00000095367432,"wires":[["3e9e9ffb.227fd8"]]},{"id":"3e9e9ffb.227fd8","type":"function","z":"3a937b2a.42833c","name":"Extract Tweet Text is in English","func":"if (msg.payload.lang === \"en\"){\n    msg.payload = msg.payload.text;\n    return msg;\n}\n","outputs":1,"noerr":0,"x":222.21431350708008,"y":234.42858505249023,"wires":[["2d6fd3a9.cee9d4","92afeab9.f79d18"]]},{"id":"28147bf6.07e24c","type":"function","z":"3a937b2a.42833c","name":"Round Number","func":"var value = msg.payload;\nmsg.payload = value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":1042.1428604125977,"y":365.71427965164185,"wires":[["41810814.2407b"]]},{"id":"45c0950c.78e094","type":"ui_group","z":"","name":"Default","tab":"ccc37cd4.e125e","disp":true,"width":"6"},{"id":"f6cd35cc.199d2","type":"twitter-api-connection","z":"","consumerKey":"","consumerSecret":"","accessToken":"","accessSecret":""},{"id":"ccc37cd4.e125e","type":"ui_tab","z":"","name":"Main Menu","icon":"dashboard","order":1}]

Flow Info

Created 7 years, 4 months ago
Updated 7 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x3)
  • range (x1)
Other

Tags

  • twitter
  • gauge
  • sentiment
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option