Created
September 10, 2021 10:13
-
-
Save joshstovall/705851e1f3c5b50829f5f8fa500ba4be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sentimentAnalysis() { | |
var tweets = JSON.parse(body).statuses | |
tweets = JSON.parse(body).statuses.map(function (e) { | |
// clean tweet | |
var tweet = clean(e.text) | |
// sentiment analysis | |
var result = new Sentiment().analyze(tweet, { | |
extras: words | |
}) | |
// return the results | |
return { | |
comparative: result.comparative, | |
score: result.score, | |
content: tweet | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment