Skip to content

Instantly share code, notes, and snippets.

@raws
Created July 29, 2010 16:46
Show Gist options
  • Save raws/498626 to your computer and use it in GitHub Desktop.
Save raws/498626 to your computer and use it in GitHub Desktop.
doc = Hpricot(open("http://www.teomyr.eu/wowhead/irc-quotes?start=#{offset}"))
doc.search("div.quote").each do |quote|
date = Time.parse((quote/"div.quote-header").inner_text[/\d{4}\-\d{2}\-\d{2}\s+\d{2}:\d{2}/])
body = (quote/"p.quote").inner_text.gsub(/^(?:[\[\]\d:]+)\s*(.*)$/, '\1').gsub(/<[@\+]/, "<")
quotes << {
:date => date,
:body => body
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment