From: Vitor Peres Date: 2007-12-06T03:25:39+09:00 Subject: Re: Screen Scraping an Image ------=_Part_2119_27573760.1196879140216 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Dec 3, 2007 8:39 PM, Sean Kenney wrote: > Here's a script I found at > http://www.rubynoob.com/articles/2006/8/21/how-to-download-files-with-a-ruby-script > > require 'net/http' > > Net::HTTP.start("static.flickr.com") { |http| > resp = http.get("/92/218926700_ecedc5fef7_o.jpg") > open("fun.jpg", "wb") { |file| > file.write(resp.body) > } > } > > Or maybe shorter: require 'open-uri' open('image.jpg', 'wb') {|f| f << open(' http://www.domain.com/image.jpg').read } ------=_Part_2119_27573760.1196879140216--