After reading sch's post, I realized I should have posted this a while ago.

This will retrieve the most current image from NOAA and upload it to a website.

It's currently set to capture the Mount Holly, NJ radar, and crop it to 300x200, centered on Glassboro, NJ. You can modify this, follow the instructions in the comments.

#!/usr/bin/perl -w use strict; use LWP::Simple; use Image::Magick; use Net::FTP; ### Modify these values for your purposes my $tempfile = "temp.gif"; # leave as gif my $outfile = "weather.jpg"; # change file type as desired my %web = ( 'dir' => '/httpdocs/images', 'user' => 'username', 'pass' => 'password', 'server' => 'server.tld' ); my %image = ( 'xlength' => '300', 'ylength' => '200', 'xoffset' => '115', 'yoffset' => '256' ); my $url = q[ http://weather.noaa.gov/radar/images/DS.80stp/SI.kdix/lat +est.gif ]; # Image to grab my $tos = 1800; # Time to Sleep (30 Min, suggested) ### my $count = 1; while(1){ print "Starting iteration $count\n"; print "Getting image...\n"; getstore($url, $tempfile); my $o = new Image::Magick; $o->Read("$tempfile"); print "Modifying Image...\n"; my $geo = $image{xlength}.'x'.$image{ylength}.'+'.$image{xoffset}.'+'. +$image{yoffset}.'!'; $o->Crop(geometry=>$geo); if(0){ # set to one for comments $o->Annotate(text=>"Current Weather from NOAA", font=>"Verdana", pointsize=>12, antialias=>"true", x=>150, y=>180, align=>"Center", fill=>"#ffffff", stroke=>"#ffffff", strokewidth=>"2"); } $o->Write(filename=>"$outfile", compression=>"jpeg"); print "Uploading file...\n"; my $ftp = Net::FTP->new($web{server}); $ftp->login($web{user},$web{pass}); $ftp->cwd($web{dir}); $ftp->binary(); $ftp->delete($outfile); $ftp->put($outfile); print "Sleeping for $tos seconds.\n\n"; sleep($tos); $count++; }

John J Reiser
newrisedesigns.com