#!/usr/bin/ruby/
require 'socket'
unless ARGV.length == 2
puts "usage: ruby rirc.rb <host> <channel>"
exit
end
host = ARGV[0]
channel = ARGV[1]
sock = TCPSocket.open(host, 6667)
sock.send "NICK wowwbot\r\n"
sock.send "USER wowwbot {host} the bot :Brobot\r\n"
sock.send "JOIN {channel}\r\n"
while line = sock.gets
puts line.chomp
end
sock.close