/**
  * 
  * @param page URL $url
  */
 static function tableauData($url)
 {
     $tableauData = array();
     $file = fopen($url, "r");
     while (!feof($file)) {
         // line per line
         $line = fgets($file);
         // read a line
         if (WindguruGetData::isGoodLine($line)) {
             // choose good line where every data is
             $windPart = WindguruGetData::getPart(WindguruGetData::exprWindPart, $line);
             // get wind part in line
             $tableauData['wind'] = WindguruGetData::getElemeInPart($windPart);
             // transforme to tab
             $hourePart = WindguruGetData::getHourePart($line);
             $tableauData['heure'] = WindguruGetData::getElemeInPart($hourePart);
             // transforme to tab
             $datePart = WindguruGetData::getDatePart($line);
             $tableauData['date'] = WindguruGetData::getElemeInPart($datePart);
             // transforme to tab
         }
     }
     fclose($file);
     return $tableauData;
 }
Example #2
0
 function analyseData($tabData, $url)
 {
     $tableauData = array();
     foreach ($tabData as $line) {
         if (WindguruGetData::isGoodLine($line)) {
             // choose good line where every data is
             $windPart = WindguruGetData::getPart(WindguruGetData::exprWindPart, $line);
             // get wind part in line
             $tableauData['wind'] = WindguruGetData::getElemeInPart($windPart);
             // transforme to tab
             $windDirPart = WindguruGetData::getPart(WindguruGetData::exprWindDirPart, $line);
             // get wind direction part in line
             $tableauData['orientation'] = WindguruGetData::getElemeInPart($windDirPart);
             // transforme to tab
             $hourePart = WindguruGetData::getHourePart($line);
             $tableauData['heure'] = WindguruGetData::getElemeInPart($hourePart);
             // transforme to tab
             $datePart = WindguruGetData::getDatePart($line);
             $tableauData['date'] = WindguruGetData::getElemeInPart($datePart);
             // transforme to tab
             $updateTime = WindguruGetData::getSpecialPart(WindguruProGetData::exprUpdateTime, $line);
             $tableauData['update'] = array($updateTime);
         }
     }
     return $tableauData;
 }