Skip to content

Instantly share code, notes, and snippets.

@tansengming
Created February 26, 2009 09:22
Show Gist options
  • Save tansengming/70748 to your computer and use it in GitHub Desktop.
Save tansengming/70748 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hpricot'
feed = 'data/input.feed'
h = Hpricot(File.read feed)
puts (h/'description')[1..-1].inner_html.map{|str| str.gsub('&lt;','<')}.map{|str| str.gsub('&gt;','>')}.map{|str| (Hpricot(str)/'img').map{|img| img.attributes['src']}.join("\n")}.join.gsub('"', '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment