Skip to content

Instantly share code, notes, and snippets.

@dafrancis
Created July 26, 2011 11:09
Show Gist options
  • Save dafrancis/1106509 to your computer and use it in GitHub Desktop.
Save dafrancis/1106509 to your computer and use it in GitHub Desktop.
require 'isaac'
require 'nokogiri'
require 'open-uri'
page = Nokogiri(open("http://listverse.com/2007/10/08/40-quotes-of-oscar-wilde/"))
quotes = page.css(".post-content p").find_all do |line|
('1'..'9').include? line.text[0]
end
quotes.map! do |quote|
quote.text.gsub(/(^[0-9]+?\. |\[.*)/,'')
end
configure do |c|
c.nick = "OscarBOT"
c.server = "irc.aberwiki.org"
c.port = 6667
end
on :connect do
join "#42"
end
on :channel, // do
msg channel, quotes.sample if nick == "Redache"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment