Skip to content

leejarvis/irc-socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

IRCSocket is an IRC wrapper around a TCPSocket. It implements all of the major commands laid out in RFC 2812. All these commands are available as instance methods of an IRCSocket Object.

API documentation is available here

Example

irc = IRCSocket.new('irc.freenode.org')
irc.connect

if irc.connected?
  irc.nick "HulkHogan"
  irc.user "Hulk", 0, "*", "I am Hulk Hogan"

  while line = irc.read

    # Join a channel after MOTD
    if line.split[1] == '376'
      irc.join "#mychannel"
    end

    puts "Received: #{line}"
  end
end

Installation

gem install irc-socket

Or alternatively you can clone the Github repository

git clone https://github.com/injekt/irc-socket

Notes

I may have missed something in the RFC. Patches welcome.

About

An IRC wrapper around TCPSocket

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages