#!/usr/local/bin/perl -w ################## # Copyright 2007 Jason Kohles (JSK), ################## use strict; use warnings; use LWP::Simple qw( getstore head ); use POSIX 'strftime'; #chdir( "/home/weather/noaa-goes-images" ) or die "Cannot chdir: $!"; for my $loc ( qw( EC WC ) ) { for my $type ( qw( VS IR WV ) ) { my $url = "http://www.goes.noaa.gov/GIFS/".$loc.$type.".JPG"; my $epoch = ( head( $url ) )[ 2 ] || next; my $time = strftime( '%F-%T', gmtime( $epoch ) ); my $file = lc( join( '-', $loc, $type, $time ).'.jpg' ); next if -f $file; print "Retrieving $url to $file\n"; getstore( $url, $file ); } }