Skip to content

Instantly share code, notes, and snippets.

@rjp
Created January 8, 2009 10:26
Show Gist options
  • Save rjp/44676 to your computer and use it in GitHub Desktop.
Save rjp/44676 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hpricot'
require 'open-uri'
url = ARGV[0]
doc = Hpricot(open(url))
a = []
doc.search('//p').each { |para|
if para.inner_text =~ /^\s*-/ then
a.push para.inner_text
end
}
puts a.reverse.join("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment