Skip to content

Connection refused #17

@NHQ

Description

@NHQ

Hiya,

I tried throwing this in a quick app, but am getting connection refused and I can't figure out why. I read thru the module. I guess twitter is refusing the connection?

Error: ECONNREFUSED, Connection refused
    at Client._onConnect (net.js:601:18)
    at IOWatcher.onWritable [as callback] (net.js:186:12)

I've tried variously tracking and following. I also tried using the NPM version and a repo-cloned version, which I noticed had some big differences, one of them being http vs https. Niether worked, both returned the same error above. I also tried running the module on its own, not wrapped in an express app, as below. The app, mostly from your example:

var express = require('express');

var TwitterNode = require('twitter-node').TwitterNode
  , sys         = require('sys');

var app = module.exports = express.createServer();


var twit = new TwitterNode({
  user: 'astromanies', 
  password: '###',
  host: '74....',  
  port: 8000,                          
  track: ['baseball', 'football'],    
});

twit.addListener('error', function(error) {
  console.log(error.message);
});

twit
  .addListener('tweet', function(tweet) {
    sys.puts("@" + tweet.user.screen_name + ": " + tweet.text);
  })

  .addListener('limit', function(limit) {
    sys.puts("LIMIT: " + sys.inspect(limit));
  })

  .addListener('delete', function(del) {
    sys.puts("DELETE: " + sys.inspect(del));
  })

  .addListener('end', function(resp) {
    sys.puts("wave goodbye... " + resp.statusCode);
  })
  .stream();

// Configuration

app.configure(function(){
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));
});

app.configure('development', function(){
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); 
});

app.configure('production', function(){
  app.use(express.errorHandler()); 
});

app.listen(8080);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions