Internet : Afficher la meteo
Utilisation de l’API Yahoo Weather
Scénario : en paramétre la ville et le pays : http://where.yahooapis.com/geocode?q=colombes+france
Nous donne le code de la localisation (ici <woeid>55863456</woeid>)
Puis appel de la page meteo : http://weather.yahooapis.com/forecastrss?w=55863456&u=c (avec w= le code de la localisation et u=c pour Celsius)
Récupération des informations dans un fichier xml :
<yweather:units temperature= »C » distance= »km » pressure= »mb » speed= »km/h »/>
<yweather:wind chill= »13″ direction= »110″ speed= »16.09″/>
<yweather:atmosphere humidity= »47″ visibility= »9.99″ pressure= »982.05″ rising= »0″/>
<yweather:astronomy sunrise= »6:50 am » sunset= »7:06 pm »/>
<pubDate>Fri, 22 Mar 2013 4:58 pm CET</pubDate>
<yweather:condition text= »Fair » code= »34″ temp= »13″ date= »Fri, 22 Mar 2013 4:58 pm CET »/>
<yweather:forecast day= »Fri » date= »22 Mar 2013″ low= »3″ high= »13″ text= »Showers Late » code= »45″/>
<yweather:forecast day= »Sat » date= »23 Mar 2013″ low= »4″ high= »11″ text= »AM Showers » code= »39″/>
J’aime ça :
J’aime chargement…
Votre commentaire