!@# openweathermap API

gh-pages
Guillaume RISCHARD 2014-08-31 03:55:05 +02:00
parent 54bc458e27
commit 71aaba799b
1 changed files with 3 additions and 5 deletions

View File

@ -136,18 +136,16 @@ function refreshContent() {
function loadWeather() { function loadWeather() {
var city = 'Bonnevoie'; var city = 'Bonnevoie';
var country = 'lu'; var country = 'LU';
var appid = '64a2215ad2f5f944abd334578763726e'; var appid = '64a2215ad2f5f944abd334578763726e';
var request = $.ajax({ var request = $.ajax({
type: 'get', type: 'get',
// fixme: use an api that supports https // 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 ) { complete: function( response ) {
resp = response.responseText.slice(14); data = JSON.parse( response.responseText );
data = JSON.parse( resp );
weather = data.weather[0]; weather = data.weather[0];