express - Error with ntwitter module for node.js -


i'm trying build twitter streaming app using node.js , ntwitter module, here's code :

var app = require('express').createserver(), twitter=require('ntwitter');  app.listen(3000);  var feed = new twitter({ consumer_key: 'my key', consumer_secret:'my secret key', access_tocken_key:'my access tocken key', access_tocken_secret:'my access tocken secret' });  feed.stream('statuses/filter',{track: ['love', 'hate']}, function(stream){ stream.on('data',function(tweet){     console.log(tweet.text); }); }); 

but here's :

events.js:74     throw typeerror('uncaught, unspecified "error" event.');           ^ typeerror: uncaught, unspecified "error" event. @ typeerror (<anonymous>) @ eventemitter.emit (events.js:74:15) @ clientrequest.<anonymous> (/users/maximeheckel/documents/my_repositories/nodetwitter/node_modules/ntwitter/lib/twitter.js:251:14) @ clientrequest.eventemitter.emit (events.js:95:17) @ httpparser.parseronincomingclient [as onincoming] (http.js:1628:21) @ httpparser.parseronheaderscomplete [as onheaderscomplete] (http.js:119:23) @ cleartextstream.socketondata [as ondata] (http.js:1523:20) @ cleartextstream.read [as _read] (tls.js:470:10) @ cleartextstream.readable.read (_stream_readable.js:294:10) @ encryptedstream.write [as _write] (tls.js:344:25) 

i don't understand why i'm stuck i'm following lot of tutorials. when clone authors project i'm still getting error.

hope can help.

update : added

stream.on('error', function(error, code) {     console.log("my error: " + error + ": " + code); }); 

to stream function , i'm getting http 401 error

any ideas ?

everything code looks fine except spelling of "token" in parameters passed constructor twitter. need change access_tocken_key access_token_key , access_tocken_secret access_token_secret. error (401) authentication issue; change should result in ntwitter passing correct user authentication details twitter api.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -