/ / Obter informações sobre o tempo em Titânio - titânio, titânio-móvel, tempo, clima-api

Obtenha informações sobre o tempo em Titânio - titânio, titânio-móvel, tempo, clima-api

Alguém sabe como obter informações sobre o tempo em Titanium? Eu li que a API do Google Weather não está mais disponível. eu tentei esse link mas eu não consigo descobrir como colocar isso para funcionar.

Alguém tem um código de trabalho? Eu gostaria de obter o tempo na minha posição dada pela longitude e latitude.

Respostas:

0 para resposta № 1
Titanium.Geolocation.getCurrentPosition(function(e) {
if (e.error) {
return;
} else {
var lon = e.coords.longitude;
var lat = e.coords.latitude;
if (Ti.Network.networkType == Ti.Network.NETWORK_NONE) {
return;
} else {
var client = Ti.Network.createHTTPClient({
onload : function(e) {
var weather = JSON.parse(this.responseText);
getweatherIcon(weather.weather[0].icon);
setweatherText(weather.weather[0].id, weather.main.temp);
},
onerror : function(e) {
},
timeout : 150000
});
client.open("GET", "http://api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&lon=" + longitude + "&appid=CreatedAppID");
client.send();
}
}
});

O "CreatedAppID" é o ID que criei depois de criar uma conta no link fornecido acima.