update where data comes from to get it from the JSON blob rather than the body
This commit is contained in:
parent
731e7e6f3e
commit
19f59cb0aa
7
new.pl
7
new.pl
@ -67,10 +67,11 @@ foreach my $station (@stations) {
|
|||||||
|
|
||||||
$stationname = $stationdata->{'name'};
|
$stationname = $stationdata->{'name'};
|
||||||
# $level = $leveldata->[0]->{_};
|
# $level = $leveldata->[0]->{_};
|
||||||
$res->content =~ m~Latest recorded level <strong class="bold-small">(-?[\d\.]+)m~;
|
$res->content =~ /"recentValue":{"ts":"([^"]+)","_":(\d+.\d+),"err":false}}/;
|
||||||
$level = $1;
|
# $res->content =~ m~Latest recorded level <strong class="bold-small">(-?[\d\.]+)m~;
|
||||||
|
$level = $2;
|
||||||
# $res->content =~ m~Recorded at (.*)~;
|
# $res->content =~ m~Recorded at (.*)~;
|
||||||
$res->content =~ m~Recorded at ([^<]+)<~;
|
# $res->content =~ m~Recorded at ([^<]+)<~;
|
||||||
my $lastupdate_str = $1;
|
my $lastupdate_str = $1;
|
||||||
$lastupdate = UnixDate($lastupdate_str, "%Y-%m-%dT%T.000Z");
|
$lastupdate = UnixDate($lastupdate_str, "%Y-%m-%dT%T.000Z");
|
||||||
# $lastupdate = UnixDate($leveldata->[0]->{ts}, "%Y-%m-%dT%T.000Z");
|
# $lastupdate = UnixDate($leveldata->[0]->{ts}, "%Y-%m-%dT%T.000Z");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user