Skip to content

Instantly share code, notes, and snippets.

@Noxn
Created June 12, 2010 13:50
Show Gist options
  • Save Noxn/435756 to your computer and use it in GitHub Desktop.
Save Noxn/435756 to your computer and use it in GitHub Desktop.
require 'socket'
class Lurker
def initialize(channel, server, name)
@channel, @server, @name = channel, server, name
end
def connect
#Create socket, send ident, name and other stuff.
#Connect to channel.
end
def start
@work = true
log
end
def log
while @work
#Socket receive and store.
#Respond to pings.
end
end
def stop
@work = nil
#Socket send disconnect message, and disconnect.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment