 http = require 'http'
 querystring = require 'querystring'
+
+attackError =
+  attack: "window.location = 'https://www.google.com/search?q=dont+hack+me+bro'"
+
+niceError = 'Name Your Stack Correctly'
+
+rooms = [
+  'newStacks'
+  'topStacks'
+]
 
 sockets = (io, db) ->
   # Request Options

      req.end()

    socket.on 'share', (data) ->
      error = 'Name Your Stack Correctly'
      return socket.emit 'error', error unless data? and data.name?
      return socket.emit 'error', error unless String(data.name).length < 30
      db.create data, (err, stack) ->
        upvotes[stack._id] = []
        dnvotes[stack._id] = []

          io.sockets.in('topStacks').emit 'topStack', stacks

    socket.on 'upvote', (id) ->
      return socket.emit 'error', attackError if id?
      unless socket.handshake.address in upvotes[id]
        upvotes[id].push socket.handshake.address
        db.findById id, (err, stack) ->
