Previous updates

This commit is contained in:
Matthew Slowe 2019-06-04 20:37:24 +01:00
parent 00d601fca5
commit a3809de919

9
new.pl
View File

@ -65,9 +65,14 @@ foreach my $station (@stations) {
my $leveldata = from_json($1);
$stationname = $stationdata->{'name'};
$level = $leveldata->[0]->{_};
# $level = $leveldata->[0]->{_};
$res->content =~ m~Latest recorded level <strong class="bold-small">(-?[\d\.]+)m~;
$level = $1;
# $res->content =~ m~Recorded at (.*)~;
$lastupdate = UnixDate($leveldata->[0]->{ts}, "%Y-%m-%dT%T.000Z");
$res->content =~ m~Recorded at ([^<]+)<~;
my $lastupdate_str = $1;
$lastupdate = UnixDate($lastupdate_str, "%Y-%m-%dT%T.000Z");
# $lastupdate = UnixDate($leveldata->[0]->{ts}, "%Y-%m-%dT%T.000Z");
print STDERR "[$station] $stationname is $level at $lastupdate\n" if $ENV{R_DEBUG};
if($ENV{R_GPLOT}) {