Skip to content

Instantly share code, notes, and snippets.

@danopia
Forked from duckinator/gist:402678
Created May 16, 2010 05:15
Show Gist options
  • Save danopia/402683 to your computer and use it in GitHub Desktop.
Save danopia/402683 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