Slight tweak to sentiment info to reflect reality.

This commit is contained in:
Dave C-J
2013-11-21 08:47:34 +00:00
parent e1dbb95396
commit 1967046cc8
2 changed files with 9 additions and 11 deletions

View File

@@ -19,14 +19,13 @@ var sentiment = require('sentiment');
function SentimentNode(n) {
RED.nodes.createNode(this,n);
var node = this;
this.on("input", function(msg) {
var node = this;
sentiment(msg.payload, function (err, result) {
msg.sentiment = result;
node.send(msg);
});
sentiment(msg.payload, function (err, result) {
msg.sentiment = result;
node.send(msg);
});
});
}
RED.nodes.registerType("sentiment",SentimentNode);