Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created February 26, 2011 03:36
Show Gist options
  • Select an option

  • Save vangberg/844909 to your computer and use it in GitHub Desktop.

Select an option

Save vangberg/844909 to your computer and use it in GitHub Desktop.
require "ircator"
irc = Ircator::Connection.new(
:nick => "ircator",
:host => "irc.ircator.com",
:port => 6667,
:password => "secret"
)
irc.transmit "JOIN #channel"
while m = irc.receive
case m[:command]
when "JOIN" then
puts "<< #{m[:prefix]} joined #{m[:params].first} >>"
when "PRIVMSG" then
puts "[#{m[:params].first}|#{m[:prefix]}] #{m[:params].last}"
when "PART" then
puts "<< #{m[:prefix]} left #{m[:params].first} >>"
when "QUIT" then
puts "<< #{m[:prefix]} quit >>"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment