Created
August 29, 2009 23:44
-
-
Save darkhelmet/177764 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
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