Challenge for you: help me find some info on the internet.

notfred

Lifer
Feb 12, 2001
38,241
4
0
I'm trying to find a site that has rainfall data by day, for at least the last year. Basically I want to be able to select a city (or airport, or some sort of location near me), and a year, and have it display a list of how much rain fell every day that year. I can't find it anywhere on NOAAs sites, and I've been looking on google, too.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: yobarman
Farmer's Almanac?

Well, they give you the data, one day at a time.

Here's a perl script that will get the total number of days of rain for a particular year:

#!perl
use strict;
use LWP::Simple;

my $raindays = 0;

my $year = 2003;
foreach my $mo(1..12){
my $last = 30;
if ($mo == 1 || $mo == 3 || $mo == 5 || $mo == 7 || $mo == 8 || $mo == 10 || $mo == 12){$last++}
if ($mo == 2) {$last = 28}

foreach my $day(1..$last){
my $page = get("http://www.almanac.com/weather...number=724839&day=$day&month=$mo&year=$year");
if ($page =~ m~Rain</B></FONT>&amp;nbsp;<img src="xbox.gif"~){

print "no rain: $mo/$day/$year\n";
}
else{
$raindays++;
print "rained: $mo/$day/$year\n";
}
}
}

print "Total rain days for $year: $raindays";