xxxxxxxxxx
var baseurl = 'https://api.openweathermap.org/data/2.5/weather';
var city = 'Honolulu, Hawaii, USA';
var appid = '7bbbb47522848e8b9c26ba35c226c734';
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(24);
}
function draw() {
background(255);
text(weather.name, 40, 40);
text(weather.coord.lat + ' by ' + weather.coord.lon, 40, 60);
text(weather.main.temp + ' F', 40, 80);
}