/** * EXTRA 1: App Meteo con Open-Meteo * * Open-Meteo è un'API PUBBLICA e GRATUITA che NON richiede autenticazione! * Puoi fare centinaia di richieste al giorno senza problemi. * * API Base: https://api.open-meteo.com/v1/forecast */ /** * Ricerca il meteo per latitudine e longitudine * * Parametri obbligatori: * - latitude: numero decimale * - longitude: numero decimale * - current: variabili da ottenere (separati da virgola) * - timezone: 'auto' oppure fuso orario specifico */ async function searchWeather() { const latitude = document.getElementById('latitude').value; const longitude = document.getElementById('longitude').value; const loading = document.getElementById('loading'); const container = document.getElementById('weatherContainer'); // VALIDAZIONE if (!latitude || !longitude) { container.innerHTML = '
Condizione: ${weather.descrizione}
Umidità: ${current.relative_humidity_2m}%
Codice Meteo: ${current.weather_code}