var express = require('express');
var http = require('http');
var twitter = require('twitter');
var config = require('./utils/config');
var streamHandler = require('./utils/streamHandler');

var app = express();
var port = process.env.PORT || 8080;

app.disable('etag');

var server = http.createServer(app).listen(port, function() {
  console.log('Express server listening on port ' + port);
});

var twit = new twitter(config.twitter);

var io = require('socket.io').listen(server);

var keywords = Object.keys(config.keywords).map(function(keyword){
  return config.keywords[keyword];
}).join(', ');

twit.stream('statuses/filter',{ track: keywords}, function(stream){
  streamHandler(stream, io);
});

var countdown = config.countdown;
setInterval(function() {
  if (countdown > 0) {
    countdown--;
    io.sockets.emit('timer', countdown);
  }
}, 1000);

@@ -601,110 +601,96 @@
 );%0A%0A
-twit.stream('statuses/filter',%7B track: keywords%7D, function(stream)%7B%0A  streamHandler(stream, io);%0A%7D
+io.sockets.on('connection', function(socket)%7B%0A  console.log('New client connected'
 );%0A%0A
+  
 var 
@@ -719,16 +719,19 @@
 ntdown;%0A
+%0A  
 setInter
@@ -747,16 +747,18 @@
 ion() %7B%0A
+  
   if (co
@@ -776,16 +776,18 @@
 ) %7B%0A    
+  
 countdow
@@ -791,16 +791,18 @@
 down--;%0A
+  
     io.s
@@ -840,10 +840,14 @@
 ;%0A  
-%7D%0A
+  %7D%0A  
 %7D, 1
@@ -852,8 +852,114 @@
  1000);%0A
+%7D);%0A%0Atwit.stream('statuses/filter',%7B track: keywords%7D, function(stream)%7B%0A  streamHandler(stream, io);%0A%7D);%0A

Add `connection` socket handling