X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/0fef6d04b13ead8ded7ce2bb73b617f5409890b9..refs/heads/master:/Command/WeatherCommand.php diff --git a/Command/WeatherCommand.php b/Command/WeatherCommand.php index c6fe6fc..0318383 100644 --- a/Command/WeatherCommand.php +++ b/Command/WeatherCommand.php @@ -177,6 +177,12 @@ class WeatherCommand extends DoctrineCommand { //Set stop day $day = $stop->diff((new \DateTime('now'))->setTime(0, 0, 0))->d + 1; + //Skip 4th day + //XXX: accuweather only allow until 3rd day + if ($day >= 4) { + continue; + } + //Check if zipcode date is set if (!isset($zipcodes[$zipcode][$day])) { $zipcodes[$zipcode][$day] = [ $sessionId => $sessionId ]; @@ -265,7 +271,7 @@ class WeatherCommand extends DoctrineCommand { //Iterate on each link containing data foreach($sx->xpath('//a[contains(@class,"daily-forecast-card")]') as $node) { //Get date - $dsm = trim($node->div[0]->h2[0]->span[1]); + $dsm = trim((string)$node->div[0]->h2[0]->span[1]); //Get temperature $temperature = str_replace('°', '', (string)$node->div[0]->div[0]->span[0]);