Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/04/2008, 05:12
Avatar de frins
frins
 
Fecha de Ingreso: enero-2008
Ubicación: Osor, Girona
Mensajes: 227
Antigüedad: 17 años
Puntos: 5
Busqueda Grafico cogiendo datos de XML

Hola amigos, tengo una web que coje los datos de los archivos XML de weather.com

Me gustaria hacer un grafico de por ejemplo de los últimos 5 dias de la temperatura.

Tambien tengo la libreria GD de PHP.

Se puede hacer con Flash?

Muchas Gracias

-Frins

Script:


Código PHP:
<?php
   
//this is keith devens xml unserializer function; i just put it in a separate file;
   
require('includes/inc.xml.php');
   
   
$file 'http://xoap.weather.com/weather/local/SPXX0143?cc=*&dayf=5&prod=xoap&par=1047702750&key=903ad8bff425e755&unit=m';
   
$xml file_get_contents($file);
   
   
$data XML_unserialize($xml);
   
   
$location $data['weather']['loc']['dnam'];
   
$sunrise $data['weather']['loc']['sunr'];
   
$sunset $data['weather']['loc']['suns'];
   
$temp $data['weather']['cc']['tmp'];
   
$flik $data['weather']['cc']['flik'];
   
$windMPH $data['weather']['cc']['wind']['s'];
   
$windGust $data['weather']['cc']['wind']['gust'];
   
$windDir $data['weather']['cc']['wind']['t'];
   
$bar$data['weather']['cc']['bar'];
   
$icon '<img src="images/64x64/' $data['weather']['cc']['icon'] . '.png" alt="" />';
  
  
   echo 
'<h4>' $location '</h4>';
   echo 
$icon;
   echo 
'<p>';
   echo 
'Sunrise: ' $sunrise '<br />';
   echo 
'Sunset: ' $sunset '<br />';
   echo 
'Temp: ' $temp '&deg;<br />'
   echo 
'Feels Like: ' $flik '&deg;<br />';
   echo 
$windDir ' ' $windMPH ' mph wind gusting to ' $windGust ' km/h.';
   echo 
'</p>';
   
 
?>

Última edición por frins; 13/04/2008 a las 05:19