Przykład:
Wroclaw, Lower Silesian Voivodeship1
wroclaw1
2012-02-161
Przy okazji jak zmienić 'Lower Silesian Voivodeship' tak by było też w języku polskim? Już w pliki XML jest w wersji EN.
Pogodę wyświetlam skryptem znalezionym w sieci i lekko go zmodyfikowalem:
<?php $xml = simplexml_load_file('http://www.google.com/ig/api?weather=wroclaw&hl=pl&oe=utf-8'); $information = $xml->xpath('/xml_api_reply/weather/forecast_information'); $current = $xml->xpath('/xml_api_reply/weather/current_conditions'); $forecast_list = $xml->xpath('/xml_api_reply/weather/forecast_conditions'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Google Weather API</title> </head> <body> <h2>Prognoza na dziś:</h2> <div class="weather"> </div> <h2>Prognoza</h2> <?php foreach ($forecast_list as $forecast) : ?> <table style="border-collapse:collapse; border-bottom: solid 2px #000000;"> <tr> </tr> </table> <?php endforeach ?> </body> </html>