const API_KEY = `xxxxxxxxxxxxxxxxx`;
generate_weather_data();
// ========= functions ==========
function city_setup() {
const CITY_ARRAY = [
'Seoul'
, 'Seattle'
, 'Goyang'
, 'London'
, 'Tokyo'
, 'Osaka'
, 'Busan'
, 'New York'
];
return CITY_ARRAY;
}
function generate_weather_data() {
let cities = city_setup();
let API_LINK = ``;
for (let i = 0; i < cities.length; i++) {
API_LINK = `https://api.openweathermap.org/data/2.5/weather?q=${cities[i]}&appid=${API_KEY}`;
fetch(API_LINK)
.then(response => response.json())
.then(data =>
console.log(`City: ${data.name} Weather: ${data.weather[0].main}`
));
}
}
console.log("hello from weather");
초보라 복잡한것도 딱히 없다...
복잡한게 없으니, 생각한대로 쉽게 구현되고 결과도 생각보다 잘 나온다...
재미 없을 수 가 없다...
반면 문과 는 어떻게 하면 남들과 다르게 쓸까, 다른 관점으로 볼까 하는거에 뇌를 쥐어 짜게 되서 재미가 없다...
후..........
후........
우쭐대지마라 넌 1000000개중에 겨우 1개를 한 셈이니깐.. - dc App
생각보다 쉽게 되서 자만할뻔 했다.. 마인드를 바로 잡아줘서 고맙다... 후....
될놈이다 - dc App