On Fri, Jun 29, 2001 at 11:40:00AM -0500, Brian wrote:
> I need to find a way to download images off of an http server. Is there
> any way of doing this? I'm sure there's an obvious solution right under
> my nose but I can't seem to find it. What I want to do is write a script
> to put in cron.hourly that goes to some website
> (www.somesite/images/certainimage.jpg) and saves it with a filename of
> datetime_certainimage.jpg. Then I can pipe it through a java applet
> and animate it. I have the java stuff worked out but I need to script the
> saving of the image. Is there a utility out there that accomplishes
> this? I tried lynx www.somesite/images/certainimage.jpg > file but lynx
> didn't like that. TIA!
A little perl script should do the trick:
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
getstore('http://www.somesite/images/certainimage.jpg', '/path/' . time . '_certainimage.jpg');
__END__
--
Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
mod_pointer <http://stderr.net/mod_pointer>