Skip to content

Instantly share code, notes, and snippets.

@snuxoll
Created March 18, 2009 11:02
Show Gist options
  • Save snuxoll/81062 to your computer and use it in GitHub Desktop.
Save snuxoll/81062 to your computer and use it in GitHub Desktop.
require 'network_connection'
conn = NetworkConnection.new('irc.freenode.net', 6667)
# Create a new handler for the event
conn.data_received + lambda do |server, text|
if text =~ /^PING/
server.send(text.gsub(/^PING/, "PONG"))
end
end
conn.connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment