From 71aaba799b2543aa0dc057eb760c227d56348707 Mon Sep 17 00:00:00 2001 From: Guillaume RISCHARD Date: Sun, 31 Aug 2014 03:55:05 +0200 Subject: [PATCH] !@# openweathermap API --- js/level2.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/level2.js b/js/level2.js index a0e1e06..59a0b3c 100644 --- a/js/level2.js +++ b/js/level2.js @@ -136,18 +136,16 @@ function refreshContent() { function loadWeather() { var city = 'Bonnevoie'; - var country = 'lu'; + var country = 'LU'; var appid = '64a2215ad2f5f944abd334578763726e'; var request = $.ajax({ type: 'get', // fixme: use an api that supports https - url: 'https://getcontents.herokuapp.com/?url=http://api.openweathermap.org/data/2.5/weather?units=metric&q=' + city + ',' + country + '&appid=' + appid, + url: 'https://getcontents.herokuapp.com/?url=http://api.openweathermap.org/data/2.5/weather?q=' + city + ',' + country + '&units=metric&appid=' + appid, complete: function( response ) { - resp = response.responseText.slice(14); - - data = JSON.parse( resp ); + data = JSON.parse( response.responseText ); weather = data.weather[0];