]> Raphaël G. Git Repositories - airbundle/blobdiff - Command/WeatherCommand.php
Add configure member function
[airbundle] / Command / WeatherCommand.php
index ee339810c65f721e0ee5b302e5f360153441dc24..ed7b8bec947c10d7ece6127ecd164164ddbee72d 100644 (file)
@@ -40,6 +40,7 @@ class WeatherCommand extends DoctrineCommand {
                        75006 => 'https://www.accuweather.com/fr/fr/paris-06-luxembourg/75006/hourly-weather-forecast/179147_pc?day=',
                        75007 => 'https://www.accuweather.com/en/fr/paris-07-palais-bourbon/75007/hourly-weather-forecast/179148_pc?day=',
                        75009 => 'https://www.accuweather.com/en/fr/paris-09-opera/75009/hourly-weather-forecast/179150_pc?day=',
+                       75010 => 'https://www.accuweather.com/en/fr/paris-10-entrepot/75010/hourly-weather-forecast/179151_pc?day=',
                        75012 => 'https://www.accuweather.com/en/fr/paris-12-reuilly/75012/hourly-weather-forecast/179153_pc?day=',
                        75013 => 'https://www.accuweather.com/en/fr/paris-13-gobelins/75013/hourly-weather-forecast/179154_pc?day=',
                        75015 => 'https://www.accuweather.com/en/fr/paris-15-vaugirard/75015/hourly-weather-forecast/179156_pc?day=',
@@ -54,6 +55,7 @@ class WeatherCommand extends DoctrineCommand {
                        75006 => 'https://www.accuweather.com/fr/fr/paris-06-luxembourg/75006/daily-weather-forecast/179147_pc',
                        75007 => 'https://www.accuweather.com/en/fr/paris-07-palais-bourbon/75007/daily-weather-forecast/179148_pc',
                        75009 => 'https://www.accuweather.com/en/fr/paris-09-opera/75009/daily-weather-forecast/179150_pc',
+                       75010 => 'https://www.accuweather.com/en/fr/paris-10-entrepot/75010/daily-weather-forecast/179151_pc',
                        75012 => 'https://www.accuweather.com/en/fr/paris-12-reuilly/75012/daily-weather-forecast/179153_pc',
                        75013 => 'https://www.accuweather.com/en/fr/paris-13-gobelins/75013/daily-weather-forecast/179154_pc',
                        75015 => 'https://www.accuweather.com/en/fr/paris-15-vaugirard/75015/daily-weather-forecast/179156_pc',
@@ -97,7 +99,7 @@ class WeatherCommand extends DoctrineCommand {
        }
 
        ///Process the attribution
-       protected function execute(InputInterface $input, OutputInterface $output) {
+       protected function execute(InputInterface $input, OutputInterface $output): int {
                //Kernel object
                $kernel = $this->getApplication()->getKernel();
 
@@ -259,7 +261,6 @@ class WeatherCommand extends DoctrineCommand {
                                                $temperature = str_replace('°', '', $node->div[0]->div[0]->span[0]);
 
                                                //Get rainrisk
-                                               #$rainrisk = str_replace('%', '', trim($node->div[2]))/100;
                                                $rainrisk = trim(str_replace('%', '', $node->div[1]))/100;
 
                                                //Store data
@@ -294,7 +295,6 @@ class WeatherCommand extends DoctrineCommand {
 
                                                //Iterate on each entry
                                                //TODO: wind and other infos are present in $node->div[1]->div[0]->div[1]->div[0]->p
-                                               #foreach($node->div[1]->div[0]->div[1]->div[1]->p as $p) {
                                                foreach($node->div[1]->div[0]->div[1]->div[0]->p as $p) {
                                                        //Lookup for rain entry if present
                                                        if (in_array(trim($p), ['Rain', 'Pluie'])) {
@@ -443,7 +443,6 @@ class WeatherCommand extends DoctrineCommand {
                                        //Check if realfeel differ
                                        if ($session->getRealfeel() !== $realfeel) {
                                                //Set average realfeel
-                                               #$meteo['realfeel'] = array_sum($meteo['realfeel'])/count($meteo['realfeel']);
                                                $session->setRealfeel($realfeel);
                                        }
 
@@ -468,7 +467,6 @@ class WeatherCommand extends DoctrineCommand {
                                        //Check if temperature differ
                                        if ($session->getTemperature() !== $temperature) {
                                                //Set average temperature
-                                               #$meteo['temperature'] = array_sum($meteo['temperature'])/count($meteo['temperature']);
                                                $session->setTemperature($temperature);
                                        }