Skip to content

Instantly share code, notes, and snippets.

@knolleary
Created January 8, 2014 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knolleary/2832e7986c794f55708f to your computer and use it in GitHub Desktop.
Save knolleary/2832e7986c794f55708f to your computer and use it in GitHub Desktop.
Twitter Sentiment Analysis

This flow listens for tweets mentioning a specific term, passes it through sentiment analysis and then routes the messages to one of three outputs depending if the sentiment is positive, neutral or negative.

To use this flow, the twitter node will need to be edited to add your credentials. The search term, currently set to ibm can also be configured in the twitter node.

The Switch node emits positive tweets through the top output, neutral through the middle output and negative through the bottom output.

[{"id":"dad6854b.252978","type":"twitter in","twitter":"","tags":"ibm","user":"false","name":"","topic":"tweets","x":100,"y":100,"z":"e1c9f85b.1e3608","wires":[["d63b18d.f29c4e8"]]},{"id":"d63b18d.f29c4e8","type":"sentiment","name":"","x":240,"y":100,"z":"e1c9f85b.1e3608","wires":[["ac27ffb5.53d8"]]},{"id":"ac27ffb5.53d8","type":"switch","name":"","property":"sentiment.score","rules":[{"t":"gt","v":"0"},{"t":"eq","v":"0"},{"t":"lt","v":"0"}],"checkall":"false","outputs":3,"x":380,"y":100,"z":"e1c9f85b.1e3608","wires":[[],[],[]]}]
@kinjalbshah
Copy link

Hi,

I'm able to import code . I've verified my credentials. However; I'm not sure . how to verify sentiment score ? will it be printed on debug window ?

Thanks
Kinjal Shah ( kinjalbshah@in.ibm.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment