E D R S I H C RSS
ID
Password
Join
People who take cat naps don't usually sleep in a cat's cradle.

FrontPage SaveImageFileFromWeb

# save image from web
# 2011. 1. 7

require 'open-uri'

def read_url_file(url_name_, number_)
    open(url_name_) { |from| $data = from.read }
    File.open("#{number_}.jpg", "wb:binary") { |to| to.write($data) }
end

read_url_file("http://chobocho.com/photo/sydney.jpg", 2)
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-01-08 02:07:02
Processing time 0.2586 sec