Created
July 26, 2011 11:09
-
-
Save dafrancis/1106509 to your computer and use it in GitHub Desktop.
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 '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