london underground live sentiment analysis
1.0.0
โมดูลโหนดที่วิเคราะห์ฟีด Twitter ล่าสุดที่กล่าวถึงแต่ละสายใต้ดินของลอนดอนและมากกว่าใช้การวิเคราะห์ความเชื่อมั่นของไอดอล HP ondemand เพื่อพิจารณาว่าโดยรวมแล้วแต่ละบรรทัดจะได้รับทวีตที่เป็นบวกหรือ nethive
## การใช้งาน ### inatall
npm install git://github.com/Lissy93/london-underground-live-sentiment-analysis.git
var tflSentimentAnalysis = require('tfl-sentiment-analysis');
คุณจะต้องลงทะเบียนสำหรับคีย์ API ที่ https://api-portal.tfl.gov.uk/signup และคีย์ hp ondemand ที่ http://www.idolondemand.com/signup.html ทั้งสอง ซึ่งฟรี สร้าง JSON คล้ายกับสิ่งนี้:
exports.HP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
exports.TWITTER_API = {
CONSUMER_KEY : "xxxxxxxxxxxxxxxxxxxxxxxxx",
CONSUMER_SECRET : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ACCESS_TOKEN_KEY : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ACCESS_TOKEN_SECRET : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
};
คุณควรใส่ไว้ในไฟล์แยกพร้อมกับปุ่ม API อื่น ๆ ของคุณและเพิ่มไฟล์ลงใน. gitignore ของคุณ
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 } ]