xxxxxxxxxx
var baseurl = 'https://api.openweathermap.org/data/2.5/weather';
var city = 'Honolulu, Hawaii, USA';
var appid = '3731efcdc88ed833acf0d7a0a524408e';
var units = 'imperial';
function preload() {
var URL = baseurl+'?q='+city+'&units='+units+'&appid='+appid;
console.log('downloading... ' + URL);
weather = loadJSON(URL);
}
function setup() {
createCanvas(windowWidth, windowHeight);
noLoop();
background(255);
stroke(0);
fill(0);
console.log(weather);
textSize(90);
text(weather.name, 100, 100);
text(weather.main.temp + ' F', 100, 200);
text(weather.weather[0].description, 100, 300);
}
function draw() {
}
•
downloading... https://api.openweathermap.org/data/2.5/weather?q=Honolulu, Hawaii, USA&units=imperial&appid=3731efcdc88ed833acf0d7a0a524408e