diff --git a/test/manual-test-examples/async/loadJSON_callback/sketch.js b/test/manual-test-examples/async/loadJSON_callback/sketch.js index 85517d7377..43f663f455 100644 --- a/test/manual-test-examples/async/loadJSON_callback/sketch.js +++ b/test/manual-test-examples/async/loadJSON_callback/sketch.js @@ -36,9 +36,8 @@ function getWeather() { var cityName = userInput.value(); var URL = - 'http://api.openweathermap.org/data/2.5/weather?q=' + - cityName + - '&units=metric'; + 'https://wttr.in/' + encodeURIComponent(cityName) + '?format=j1'; + result = loadJSON(URL, displayWeather); // displayWeather is the callback } @@ -47,9 +46,9 @@ function displayWeather() { print(result); // result is ready! var location = result.name; - var currentTemp = result.main.temp; + var avgTemp = result.weather[0].avgtempC; text( - 'Current temperature in ' + location + ' is ' + currentTemp + ' celsius', + 'Today\'s average temperature in ' + location + ' is ' + avgTemp + ' celsius', width / 2, height / 2 ); diff --git a/test/manual-test-examples/async/loadJSON_options/sketch.js b/test/manual-test-examples/async/loadJSON_options/sketch.js index c3a154920b..170d3d9026 100644 --- a/test/manual-test-examples/async/loadJSON_options/sketch.js +++ b/test/manual-test-examples/async/loadJSON_options/sketch.js @@ -1,7 +1,7 @@ function setup() { noCanvas(); loadJSON( - 'http://api.openweathermap.org/data/2.5/station?id=5091', + 'https://wttr.in/Berlin?format=j1', parseStuff, 'json' ); diff --git a/test/manual-test-examples/async/loadJSON_preload/sketch.js b/test/manual-test-examples/async/loadJSON_preload/sketch.js index 59871f908a..9d63de2e99 100644 --- a/test/manual-test-examples/async/loadJSON_preload/sketch.js +++ b/test/manual-test-examples/async/loadJSON_preload/sketch.js @@ -1,5 +1,5 @@ // In this example, we want to load JSON (a JavaScript Object) -// from a URL at openweathermap.org, and display it in setup(). +// from a URL at wttr.in, and display it in setup(). // // Since setup() happens faster than you can load a website, the // data does not have time to properly load before setup() is done. @@ -13,7 +13,7 @@ var result; function preload() { result = loadJSON( - 'http://api.openweathermap.org/data/2.5/weather?id=5128581&units=imperial' + 'https://wttr.in/Berlin?format=j1' ); console.log('In preload(), the result has not finished loading: '); console.log(result); @@ -29,10 +29,10 @@ function setup() { console.log('In setup(), here is the result: '); console.log(result); - var location = result.name; - var currentTemp = result.main.temp; + var location = result.nearest_area[0].areaName[0].value; + var avgTemp = result.weather[0].avgtempC; text( - 'Current temperature in ' + location + ' is ' + currentTemp + 'F', + 'Today\'s average temperature in ' + location + ' is ' + avgTemp + ' celsius', width / 2, height / 2 ); diff --git a/test/manual-test-examples/keyboard/keyIsPressed.html b/test/manual-test-examples/keyboard/keyIsPressed.html index 16a7e3b813..ca51f284cc 100644 --- a/test/manual-test-examples/keyboard/keyIsPressed.html +++ b/test/manual-test-examples/keyboard/keyIsPressed.html @@ -6,5 +6,6 @@
+Press the arrow keys, colors should change.