From 23425c2eb9e858f2bda6e231ae3686c2404ec654 Mon Sep 17 00:00:00 2001 From: Pawel Date: Sun, 30 Aug 2020 15:09:59 +0200 Subject: [PATCH] =?UTF-8?q?wyciszenie=20zaci=C4=85gania=20danych=20o=20wod?= =?UTF-8?q?owskazach?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- imgw_podest_sq9atk.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/imgw_podest_sq9atk.php b/imgw_podest_sq9atk.php index f61bd2b..14cc9cb 100644 --- a/imgw_podest_sq9atk.php +++ b/imgw_podest_sq9atk.php @@ -1,16 +1,16 @@ i, $requestIds)) continue; - + if (dataFileIsToOld('imgwpodest_data/'.$row->i.'.json', 3600)) { - $json = shell_exec("curl 'https://hydro.imgw.pl/api/station/hydro/?id=".$row->i."' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: pl,en-US;q=0.7,en;q=0.3' --compressed -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: https://hydro.imgw.pl/' -H 'Cookie: SRV_=shsrv01.imgw.pl_SRV' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache'"); + $json = shell_exec("curl --silent 'https://hydro.imgw.pl/api/station/hydro/?id=".$row->i."' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: pl,en-US;q=0.7,en;q=0.3' --compressed -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: https://hydro.imgw.pl/' -H 'Cookie: SRV_=shsrv01.imgw.pl_SRV' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache'"); file_put_contents('imgwpodest_data/'.$row->i.'.json', $json); } @@ -54,7 +54,7 @@ $tmp_river = explode(' (',$subdata->status->river); $trends = array(2 => 0, 3 => -1, 4 => 1); - + $result[$row->i] = array( 'id' => $row->i, 'nazwa' => $subdata->status->description, @@ -70,7 +70,7 @@ 'water_gauge_zero_ordinate' => $subdata->status->waterGaugeZeroOrdinate, 'lat' => $row->la, 'lon' => $row->lo - ); + ); } echo json_encode($result);