Use IBM's AlchemyLanguage sentiment/emotion analysis to visualize emotions of tweets. A fully functioning version used to be accessible here, but as the API key expired it isn't available right now.
$ npm install
- Add bluemix.auth file with valid IBM Bluemix API key. Example:
{
"api_key":"SECRET"
}
- Add twitter.auth file with valid Twitter API credentials. Example:
{
"consumer_key": "",
"consumer_secret": "",
"access_token_key": "",
"access_token_secret": ""
}
- Twitter Search API
- Twitter GET request search
- Twitter show User
- Twitter npm module
- IBM AlchemyLanguage Emotion Analysis
Sending a GET request with user
& limit
parameters set will return a JSON object describing emotions of users tweets.
For example:
$ curl http://localhost:8000/emotion?user=daschott94&limit=10
will return the following JSON object:
{
"anger": "0.034728",
"disgust": "0.006738",
"fear": "0.014644",
"joy": "0.859004",
"sadness": "0.10777",
"userName": "daschott94",
"tweets": [
"I am doing wonderful. This is fantastic.",
"What a beautiful day today"
]
}
Sending a GET request with user
parameters set will return a JSON object with account details of user.
For example:
$ curl http://localhost:8000/user?user=daschott94
will return the following JSON object:
{
"id": 804796211286917100,
"id_str": "804796211286917121",
"name": "David Schott",
"screen_name": "daschott94",
"location": "",
"profile_location": null,
"description": "",
"url": null,
"entities": {
"description": {
"urls": []
}
}
...
}
Sending a GET request with user
& limit
parameters set will return a JSON object with 10 extracted keywords and their associated sentiments.
For example:
$ curl http://localhost:8000/keywords?user=realDonaldTrump&limit=30
will return the following JSON object:
{
"status": "OK",
"usage": "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html",
"totalTransactions": "2",
"language": "english",
"keywords": [
{
"relevance": "0.983078",
"sentiment": {
"type": "neutral"
},
"text": "Treasurer John Kennedy"
},
{
"relevance": "0.966023",
"sentiment": {
"score": "-0.690225",
"type": "negative"
},
"text": "Saturday Night Live"
},
...
],
"userName": "realDonaldTrump"
}
$ npm start
- starts server on port 8000.