Dati in tempo reale Roma EUR (24 m): http://www.romaeurmeteo.it
Dati in tempo reale Abbadia San Salvatore (850 m) https://www.meteoamiata.it/
Il sito di Meteo Lazio: http://www.meteoregionelazio.it
Ho un problema: alcune variabili sul mio sito (per adesso molto rudimentale) appaiono, altre no. Ho inserito questo codice per creare la corrispondenza tra la pagina su weatherlink.com e il mio sito in php.
In particolare si vedono temperatura attuale, umidità, velocità del vento, pressione attuale, mentre altre variabili come umidità massima, pressione massima, l'orario in cui si sono verificate, sebbene io le abbia impostate, non appaiono affatto sul sito.Codice:<?php $url = "http://www.weatherlink.com/xml.php?user=user&pass=pass"; $ip = @file_get_contents($url); $object = simplexml_load_string($ip); $davis_current = $cur_obs->davis_current_observation; $cur_obs = simplexml_load_string($ip); $xml = simplexml_load_file('http://www.weatherlink.com/xml.php?user=user&pass=paass'); foreach($xml->temp_day_high_f as $tmaxf); $tmax = round(5/9*($tmaxf+32),1); foreach($xml->temp_day_low_f as $tminf); $tmin = round(5/9*($tminf+32),1); foreach($xml->relative_humidity_day_high as $hummax); foreach($xml->relative_humidity_day_low as $hummin); foreach($xml->temp_day_high_time as $tmaxh); foreach($xml->relative_humidity as $hum); foreach($xml->temp_c as $temp); foreach($xml->heat_index_c as $heat); foreach($xml->observation_time as $ultimo_aggiornamento); foreach($xml->temp_day_high_f as $max); foreach($xml->wind_kt as $velventos); $velvento = round($velventos * 1.85,1); foreach($xml->wind_dir as $dirvento); foreach($xml->wind_degrees as $grvento); foreach($xml->pressure_mb as $press); foreach($xml->windchill_c as $chill); ?> <?php $xml = simplexml_load_file('http://www.weatherlink.com/xml.php?user=romaeur&pass=scaccomatto'); foreach($xml->rain_day_in as $prec); foreach($xml->rain_rate_in_per_hr as $rrate); foreach($xml->temp_day_low_time as $tminh); foreach($xml->pressure_day_high_in as $pressmax); foreach($xml->pressure_day_high_time as $pressmaxh); foreach($xml->pressure_day_low_time as $pressminh); foreach($xml->pressure_day_low_in as $pressmin); foreach($xml->relative_humidity_day_low_time as $humminh); foreach($xml->relative_humidity_day_high_time as $hummaxh);
Poi la temperatura minima e la massima appaiono come uguali (entrambe riportano il valore di temp. minima).
Cos'ho sbagliato?
Chiaramente nel codice dove vedete scritto user e pass nel link sono sostituiti con i veri user e pass miei.
Il sito è questo: http://www.romaeurmeteo.it/home.php
Dati in tempo reale Roma EUR (24 m): http://www.romaeurmeteo.it
Dati in tempo reale Abbadia San Salvatore (850 m) https://www.meteoamiata.it/
Il sito di Meteo Lazio: http://www.meteoregionelazio.it
Segnalibri