getCurrentConditions($latitude, $longitude, $units, $lang); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.0.temp", "w") ) { print "can't create file!\n"; continue; } $temp = round($condition->getTemperature(), 1); if( $convertPoint == 1 ) $temp = str_replace(".", ",", $temp); fwrite($handle, $temp); fwrite($handle, $degree_sign); fclose($handle); // get daily conditions for next 7 days $conditions_week = $forecast->getForecastWeek($latitude, $longitude, $units, $lang); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.location", "w") ) { print "can't create file!\n"; } else { fwrite($handle, $locationSkin); fclose($handle); } $index = -1; foreach($conditions_week as $conditions) { $index++; if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".summary", "w") ) { print "can't create file!\n"; continue; } fwrite($handle, $conditions->getSummary()); fclose($handle); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".tempMin", "w") ) { print "can't create file!\n"; continue; } // we only have min & max so we must calc $temp = round($conditions->getMinTemperature(), 1); if( $convertPoint == 1 ) $temp = str_replace(".", ",", $temp); fwrite($handle, $temp); fwrite($handle, $degree_sign); fclose($handle); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".tempMax", "w") ) { print "can't create file!\n"; continue; } // we only have min & max so we must calc $temp = round($conditions->getMaxTemperature(), 1); if( $convertPoint == 1 ) $temp = str_replace(".", ",", $temp); fwrite($handle, $temp); fwrite($handle, $degree_sign); fclose($handle); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".precipitation", "w") ) { print "can't create file!\n"; continue; } fwrite($handle, $conditions->getPrecipitationProbability()); fclose($handle); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".precipitationType", "w") ) { print "can't create file!\n"; continue; } if( $conditions->getPrecipitationProbability() > 0 ) fwrite($handle, $conditions->getPrecipitationType()); else fwrite($handle, "none"); fclose($handle); if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".icon", "w") ) { print "can't create file!\n"; continue; } fwrite($handle, $conditions->getIcon()); fclose($handle); } ?>