0
私はこのapiを使用しています:http://openweathermap.org/api私は今日、翌日と翌日の翌日のデータをどのように知ることができません。どのようなパラメータを私は、どのように使用することができますか?今日、翌日、翌日の天気データの入手方法は?
私はこのようにしようと試みたが、私は迷子:Call 16 day/daily forecast data:
var weatherUrl = 'http://api.openweathermap.org/data/2.5/forecast?q=Zurich&APPID=08dbab0eeefe53317d2e0ad7c2a2e060&units=metric';
$.getJSON(
encodeURI(weatherUrl),
function(data) {
if(data !== null && data.list !== null) {
var result = data,
weather = {},
compass = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'],
image404 = 'https://s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png';
console.log(result);
for(var i = 0; i < result.list.length; i++){
weather.temp = Math.round(result.list[i].main.temp);
weather.code = result.list[i].weather[0].id;
weather.text = ucfirst(result.list[i].weather[0].description);
weather.date = result.dt_txt;
}
options.success(weather);
} else {
options.error('There was a problem retrieving the latest weather information.');
}
}
);
のthatsそれ.... TNX :) – None
@Meikoコードスニペットが機能していません。 –
@ankitsuthar plzはあなたのAPPIDに 'weatherUrl'の' APPID'を変更します –