old_contents: #Botler.py
  import os
  import sys
  import socket
  import string
  import datetime
  import smtplib
  
  HOST = "dot"
  PORT = 6667
  NICK = "Botler"
  IDENT = 'Botler'
  REALNAME = 'Botler'
  readbuffer = ""
  mainchannel = "#hackathon"
  readbuffer = ''
  s = socket.socket()
  print "Connecting to Dot..."
  
  s.connect((HOST, PORT))
  s.send("NICK %s\r\n" % NICK)
  s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
  s.send("JOIN "+mainchannel+"\r\n")
  s.send("PRIVMSG %s :Botler is Now Online and Running...\r\n" % mainchannel)
  print "Server Running"
  
  def log(message):
  		s.send('PRIVMSG ' +mainchannel+' :'+message+'\r\n')
  
  while 1:
  		data = s.recv(2048)
  		if data.find ('PING') !=-1:
  				s.send('PONG' + data.split()[1]+'\r\n') 
  		if data.find("hello") !=-1:
  				log("Hello! May I invite you to bite my shiny virtual ass?")
  							
  
  
  
new_contents: #!/usr/bin/env python3
  
  # botler: the CCoWMU IRC bot.
  
  import socket
  
  HOST = 'localhost'
  PORT = 6667
  NICK = "botler"
  IDENT = 'botler'
  REALNAME = 'botler'
  LEADER = '%'
  START_CHANNELS = ['#hackathon']
  
  def send(message):
      # TODO: break message up based on maximum message size
      s.send('{}\r\n'.format(message))
  
  def recv():
      # TODO: buffer until one line
      return s.recv(2048)
  
  def say(channel, message):
      send('PRIVMSG {} :{}'.format(channel, message))
  
  s = socket.socket()
  print('Connecting to {}:{} as {}'.format(HOST, PORT, NICK))
  
  s.connect((HOST, PORT))
  send('NICK {}'.format(NICK))
  send('USER {} {} bla :{}'.format(IDENT, HOST, REALNAME))
  for channel in START_CHANNELS:
      send('JOIN {}'.format(channel))
      send("PRIVMSG {} :Botler is Now Online and Running...".format(channel))
  print('Connected')
  
  while 1:
      data = recv()
      # TODO: parse message properly
      if data.find('PING') != -1:
          send('PONG {}'.format(data.split()[1])) 
      if data.find("hello") != -1:
          log("Hello! May I invite you to bite my shiny virtual ass?")
  
  # vim: ts=4:sw=4:et
  
subject: Normalize codebase