<?php
global $set_location;
global $default_location;

function getWeather($weather_location) {
$requestAddress = "http://www.google.com/ig/api?weather=".urlencode($weather_location)."&hl=en";
// Downloads weather data based on location
$xml_str = file_get_contents($requestAddress);
// Parses XML
$xml = new SimplexmlElement($xml_str);
// Loops XML

global $google_weather_array;
foreach($xml->weather as $item) {	
  $google_weather_array[0] = $item->current_conditions[0]->condition['data'];	   
  $google_weather_array[1] = $item->forecast_conditions[0]->low['data'];
  $google_weather_array[2] = $item->forecast_conditions[0]->high['data'];
}

return 'google weather return';

}
if($set_location) {
	getWeather($set_location);
} else {
	getWeather($default_location);
}


?>