Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created August 29, 2009 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkhelmet/177764 to your computer and use it in GitHub Desktop.
Save darkhelmet/177764 to your computer and use it in GitHub Desktop.
feed.entries.each do |e|
"Looking at the entry #{e.title.gsub("n",' ')}".printn
link = (Nokogiri(e.summary)/"img").to_html
next if link.empty?
link = link[/"(.*)"/].gsub(/["]/,'')
filename = link.split('/').last
disk_file = File.expand_path(File.join(ROOT,filename))
unless File.exists?(disk_file)
"Downloading new image #{filename}...".print
Net.download_and_save(link,disk_file)
"done!".printn
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment