Update plasma

This commit is contained in:
BuyMyMojo 2025-04-22 01:30:36 +10:00
parent cf88cf4a7b
commit d83c5a0a54
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
160 changed files with 7837 additions and 0 deletions

View file

@ -0,0 +1,27 @@
function GetForecastWeather(latitud, longitud, fechaInicio, fechaFin, callback) {
let url = `https://api.open-meteo.com/v1/forecast?latitude=${latitud}&longitude=${longitud}&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=auto&start_date=${fechaInicio}&end_date=${fechaFin}`;
let req = new XMLHttpRequest();
req.open("GET", url, true);
req.onreadystatechange = function () {
if (req.readyState === 4) {
if (req.status === 200) {
let datos = JSON.parse(req.responseText);
let daily = datos.daily;
let codes = daily.weather_code.join(' ');
let max = daily.temperature_2m_max.join(' ');
let min = daily.temperature_2m_min.join(' ');
let full = codes + " " + max + " " + min
console.log(`${full}`);
callback(full);
} else {
console.error(`Error en la solicitud: ${req.status}`);
}
}
};
req.send();
}