",
"\n";
open(FORECAST, "< $datadir/$forecasts{$city}.forecast") or die "Can't open file $!";
if ($city eq "chicago") {
my $ready = 0;
$forecast = "NWS Chicago Metropolitan Forecast -- ";
while() {
$ready = 1 if (/^CHICAGO MET/);
$ready = 0 if (/\$\$/);
if ($ready == 1) {
if (/^CHICAGO MET/ || /^NATIONAL WEA/ || /^[ ]*$/) {;}
else {
s/^\.([^.]*)\.\.\.(.*)/$1...<\/span>$2/;
s/^(TODAY|TONIGHT)\.\.\.(.*)/$1...<\/span>$2/;
$forecast .= (/" : "") . lc($_);
}
}
}
} elsif ($city eq "sf") {;
while() {
if (/SAN FRANCISCO/) {
$forecast = "NWS San Francisco Peninsula Forecast -- ";
s/.*-(.*)&&.*/$1/;
s/
\.([^.]*)\.\.\./~~$1...<\/span>/g;
s/
//g;
s/~~/\n
/g;
$forecast .= lc($_);
}
}
} elsif ($city eq "boston") {
my $ready = 0;
$forecast = "NWS Boston Forecast -- ";
while() {
s/]*>//g;
s/<\/span>//g;
$ready = 1 if (/^INCLUDING/);
$ready = 0 if (/<\/pre>/);
if ($ready == 1) {
if (/^INCLUDING/ || /^[ ]*$/) {;}
else {
s/^\.([^.]*)\.\.\.(.*)/$1...<\/span>$2/;
s/^(TODAY|TONIGHT)\.\.\.(.*)/$1...<\/span>$2/;
$forecast .= (/" : "") . lc($_);
}
}
}
} elsif ($city eq "nola") {
$forecast = "NWS Orleans Parish Forecast -- ";
my $ready = 0;
while () {
$ready = 1 if (/^INCLUDING/);
$ready = 2 if ($ready == 1 and /^\d/);
$ready = 0 if (/<\/PRE>/);
if ($ready == 2) {
if (/^INCLUDING/ || /^[ ]*$/) {;}
else {
s//
\n/;
s/<\/FONT><\/B>/...<\/span>/;
$forecast .= lc($_);
}
}
}
} elsif ($city eq "statecollege") {
$forecast = "NWS Southern Centre Forecast -- ";
my $ready = 0;
while() {
if (/ E[DC]T.*2007$/) {
$ready++;
}
if ($ready == 2) {
if (/\$\$/) {
$ready = 0;
next;
}
s/^\.([^.]*)\.\.\.(.*)/$1...<\/span>$2/;
s/^(TODAY|TONIGHT)\.\.\.(.*)/$1...<\/span>$2/;
$forecast .= (/" : "") . lc($_);
}
}
}
close(FORECAST);
print $forecast;
print "
\n";
}#}}}
sub print_astro {#{{{
print
qq{},
qq{\n};
for $clock (@{$clocks{$city}}) {
print<
\n
END
}
print " \n";
}#}}}
sub print_nat_loop {#{{{
print <