Hi,
I am still fairly new to Ruby.
Given the URL of an image, I would like to craft some code that grabs the
image from the remote Web server and puts it in a file on the local machine.
Can anyone give me some tips on doing that?
Thanks,
Hunter
Hi,
I am still fairly new to Ruby.
Given the URL of an image, I would like to craft some code that grabs the
image from the remote Web server and puts it in a file on the local machine.
Can anyone give me some tips on doing that?
Thanks,
Hunter
lists wrote:
Hi,
I am still fairly new to Ruby.
Given the URL of an image, I would like to craft some code that grabs
the
image from the remote Web server and puts it in a file on the local
machine.Can anyone give me some tips on doing that?
Thanks,
Hunter
requre 'open-uri'
open("output_filename.jpg", "w") { |outfile|
outfile.write open("http://image_url.jpg") { |inf|
ifile.read
}
}
--
Posted via http://www.ruby-forum.com/\.
lists wrote:
Hi,
I am still fairly new to Ruby.
Given the URL of an image, I would like to craft some code that grabs
the
image from the remote Web server and puts it in a file on the local
machine.Can anyone give me some tips on doing that?
Thanks,
Hunter
Hi All,
Get all images from given URL
Desktop Application from jazzez
Kindly go through below link and download the EXE file.
Install in Windows machine and enjoy with impressed images
Regards,
P.Raveendran
--
Posted via http://www.ruby-forum.com/\.
jimweirich wrote:
requre 'open-uri'
open("output_filename.jpg", "w") { |outfile|
outfile.write open("http://image_url.jpg") { |inf|
ifile.read
}
}
Oops ... naming problem with inf and ifile ... both should be infile.
Sorry
-- Jim Weirich
--
Posted via http://www.ruby-forum.com/\.
Thanks.
This is working like a charm!
From: Jim Weirich <jim-keyword-rforum.c88827@weirichhouse.org>
Reply-To: <ruby-talk@ruby-lang.org>
Newsgroups: comp.lang.ruby
Date: Wed, 30 Nov 2005 07:50:24 +0900
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Subject: Re: Grab Image From Web Serverjimweirich wrote:
requre 'open-uri'
open("output_filename.jpg", "w") { |outfile|
outfile.write open("http://image_url.jpg") { |inf|
ifile.read
}
}Oops ... naming problem with inf and ifile ... both should be infile.
Sorry
-- Jim Weirich--
Posted via http://www.ruby-forum.com/\.
Jim Weirich wrote:
jimweirich wrote:
requre 'open-uri'
open("output_filename.jpg", "w") { |outfile|
on Windows, make this "wb" for binary data.
James
--
http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - Ruby Code & Style: Writers wanted
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
http://www.30secondrule.com - Building Better Tools
Could it be at all possible that a class has just been set an exercise
of downloading an image from a webserver, and the class notes also
pointed to the existence of the ruby-talk mailing list?
--
Posted via http://www.ruby-forum.com/.