Created
April 15, 2013 00:57
-
-
Save mechamogera/5384958 to your computer and use it in GitHub Desktop.
irc-socket gemを用いたIRCメッセージ送信Rubyスクリプトサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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