london underground live sentiment analysis
1.0.0
Eine Knotenmodule, die die jüngsten Twitter -Feeds analysiert, in denen jede Londoner Untergrundlinie erwähnt wird, und als HP -Idol -Ondemand -Sentiment -Analyse verwendet, um zu bestimmen, wie jede Zeile insgesamt positive oder negetive Tweets erhält.
## Verwendung ### Inatall
npm install git://github.com/Lissy93/london-underground-live-sentiment-analysis.git
var tflSentimentAnalysis = require('tfl-sentiment-analysis');
Sie müssen sich für eine API-Schlüssel unter https://api-portal.tfl.gov.uk/signup und auch den HP OnDemand-Schlüssel unter http://www.idolondemand.com/signup.html, beides von, anmelden die kostenlos sind. Erstellen Sie einen ähnlichen JSON wie folgt:
exports.HP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
exports.TWITTER_API = {
CONSUMER_KEY : "xxxxxxxxxxxxxxxxxxxxxxxxx",
CONSUMER_SECRET : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ACCESS_TOKEN_KEY : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ACCESS_TOKEN_SECRET : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
};
Sie sollten es zusammen mit Ihren anderen API -Schlüssel in eine separate Datei einfügen und Ihre Datei zu Ihrem .gitignore hinzufügen
tflSentimentAnalysis . fetchTflSentiments ( keys , function ( results ) {
console . log ( results ) ; // Do whatever with the results
} ) ; [ { line: 'DLR', sentiments: 'neutral', score: 0 },
{ line: 'WaterlooCity', sentiments: 'neutral', score: 0 },
{ line: 'Victoria',
sentiments: 'positive',
score: 0.5685799620527161 },
{ line: 'Picadilly', sentiments: 'neutral', score: 0 },
{ line: 'Bakerloo', sentiments: 'neutral', score: 0 },
{ line: 'Central', sentiments: 'neutral', score: 0 },
{ line: 'Overground', sentiments: 'neutral', score: 0 },
{ line: 'Jubile', sentiments: 'neutral', score: 0 },
{ line: 'District',
sentiments: 'negative',
score: -0.8177321332492695 },
{ line: 'Metropolitan', sentiments: 'neutral', score: 0 },
{ line: 'Northen', sentiments: 'positive', score: 0.48272937292926293 },
{ line: 'Hammersmith', sentiments: 'neutral', score: 0 },
{ line: 'Circle',
sentiments: 'negative',
score: -0.44023113875144726 } ]