Skip to content

Instantly share code, notes, and snippets.

@mechamogera
Created April 15, 2013 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mechamogera/5384958 to your computer and use it in GitHub Desktop.
Save mechamogera/5384958 to your computer and use it in GitHub Desktop.
irc-socket gemを用いたIRCメッセージ送信Rubyスクリプトサンプル
require 'irc-socket'
irc = IRCSocket.new('example.com')
irc.connect
if irc.connected?
irc.nick "hulk"
irc.user "hulk", 0, "*", "I am hulk hogan"
while line = irc.read
# Join a channel after MOTD
if line.split[1] == '376'
irc.join "#test"
irc.privmsg "#test", "hogehoge"
irc.part "#test"
break
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment