var http = require('http');
var path = require('path');
var fs = require('fs');
var shoe = require('shoe');
var Stweam = require('stweam');
var habitat = require('habitat');
var ecstatic = require('ecstatic');

var argv = require('yargs')
  .demand('track')
  .describe('track', 'Set the phrases that will determine what is delivered from Twitter')
  .argv;

var env = habitat.load(path.join(__dirname, '../.env'));

var server = http.createServer(
  ecstatic({ root: path.join(__dirname, '../static') })    
).listen(3000);

console.log('chirp listening on port 3000');

var twitter = new Stweam({
  consumerKey: env.get('chirpConsumerKey'),
  consumerSecret: env.get('chirpConsumerSecret'),
  token: env.get('chirpToken'),
  tokenSecret: env.get('chirpTokenSecret')
});

twitter.on('info', function(msg){
  console.log(msg);
});

twitter
  .track(argv.track)
  .start();

var sock = shoe(function(stream){
  twitter.pipe(stream);
});

sock.install(server, '/tweets');

@@ -342,16 +342,101 @@
 itter')%0A
+  .default('port', 3000)%0A  .describe('port', 'Set the port the server will bind to')%0A
   .argv;
@@ -436,16 +436,16 @@
  .argv;%0A
-
 %0Avar env
@@ -600,58 +600,148 @@
 ten(
-3000);%0A%0Aconsole.log('chirp listening on port 3000'
+argv.port, function()%7B%0A  var address = server.address();%0A  console.log('chirp listening at http://%25s:%25d/', address.address, address.port);%0A%7D
 );%0A%0A

Add ability to set server port