Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/11/2011, 15:20
pinchu
 
Fecha de Ingreso: septiembre-2009
Mensajes: 215
Antigüedad: 14 años, 7 meses
Puntos: 1
Respuesta: Script php no se ejecuta con cron jobs

Es de un código para obtener el tiempo de google weather. Esto es lo que produce los warnings:

$placename = $estacion['nombre']; // city where you want local weather
$lang = 'es';
$place = urlencode($placename);
$place = utf8_encode($place);
$url = 'http://www.google.com/ig/api?weather='.$place.',$&hl='.$lang.'';
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
$raw_data = curl_exec ($ch);
curl_close ($ch);
$xml = iconv("GB18030", "utf-8", $raw_data);
$xml = simplexml_load_string($xml);
$condition = $xml->weather->current_conditions->condition['data'];
$temp_c = $xml->weather->current_conditions->temp_c['data'];
$wind = $xml->weather->current_conditions->wind_condition['data'];
$humidity = $xml->weather->current_conditions->humidity['data'];
$icon = $xml->weather->current_conditions->icon['data'];