diff --git a/new.pl b/new.pl index dbe9162..0ffadec 100755 --- a/new.pl +++ b/new.pl @@ -67,10 +67,11 @@ foreach my $station (@stations) { $stationname = $stationdata->{'name'}; # $level = $leveldata->[0]->{_}; - $res->content =~ m~Latest recorded level (-?[\d\.]+)m~; - $level = $1; + $res->content =~ /"recentValue":{"ts":"([^"]+)","_":(\d+.\d+),"err":false}}/; + # $res->content =~ m~Latest recorded level (-?[\d\.]+)m~; + $level = $2; # $res->content =~ m~Recorded at (.*)~; - $res->content =~ m~Recorded at ([^<]+)<~; + # $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");