Note that there are some explanatory texts on larger screens.

plurals
  1. POnode.js and socket.io uncaught error
    primarykey
    data
    text
    <p>i am trying to use ntwitter ,node.js and socket.io for accessing twitter user stream.the twitter user stream works fine and i can get the tweets in real time.the tweets get displayed in the console using the following function.</p> <pre><code>console.log(data.text) ; </code></pre> <p>then i want push the data to the browser.this can be done using sockets.the following link shows example of a simple node.js client for twitetrs public stream.</p> <p><a href="http://www.informit.com/articles/article.aspx?p=1947699&amp;seqNum=5" rel="nofollow">http://www.informit.com/articles/article.aspx?p=1947699&amp;seqNum=5</a></p> <p>now the same doesn not work for my user stream.the data gets displayed in the console without any problem but if i try to push it to the browser i get error. </p> <pre><code>Error: Uncaught, unspecified 'error' event. at EventEmitter.emit (events.js:73:15) at EventEmitter.receive (C:\Users\tweeple\Desktop\ho odules\ntwitter\lib\parser.js:41:14) at IncomingMessage.Twitter.stream (C:\Users\prathamesh\ e03\node_modules\ntwitter\lib\twitter.js:266:14) at IncomingMessage.EventEmitter.emit (events.js:96:17) at IncomingMessage._emitData (http.js:359:10) at HTTPParser.parserOnBody [as onBody] (http.js:123:21) at CleartextStream.socketOnData [as ondata] (http.js:13 at CleartextStream.CryptoStream._push (tls.js:526:27) at SecurePair.cycle (tls.js:880:20) at EncryptedStream.CryptoStream.write (tls.js:267:13) </code></pre> <p>the code is:</p> <pre><code>var app = require('express').createServer(), twitter = require('ntwitter'), io = require('socket.io').listen(app); app.listen(3000); var twit = new twitter({ consumer_key: 'key', consumer_secret: 'consumer secret', access_token_key: 'token', access_token_secret: 'token secret' }); twit.stream('user', {track:'nodejs'}, function(stream) { stream.on('data', function (data) { io.sockets.emit('tweet',{ user: data.user.screen_name, text: data.text }); }); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/index.html'); }); </code></pre> <p>please help me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload