Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created May 16, 2010 05:14
Show Gist options
  • Save duckinator/402678 to your computer and use it in GitHub Desktop.
Save duckinator/402678 to your computer and use it in GitHub Desktop.
require 'socket'
s=TCPSocket.new *ARGV[0,2]
s.puts "USER A B C D
NICK waffles"
until s.eof?
s.puts case s.gets
when /^\S+ 001 /
"JOIN "+ARGV[2]
when /.+ :-quit( .+)?/
"QUIT :#{$1}"
when /.+ (.+) :-(.+)$/
"PRIVMSG #{$1} :#{$2}"
when /PING (.+)/
"PONG "+$1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment