From c9aa70e2b71ac29f582e5fc7ba8797d606ec3177 Mon Sep 17 00:00:00 2001 From: nitishkhobragade Date: Mon, 13 May 2024 17:40:26 +0530 Subject: [PATCH] started 26_weather_app_01 started api based 26_weather_app_01 --- 26_weather_app_01/app.js | 17 +++++++++++++++++ 26_weather_app_01/index.html | 12 ++++++++++++ 26_weather_app_01/style.css | 0 3 files changed, 29 insertions(+) create mode 100644 26_weather_app_01/app.js create mode 100644 26_weather_app_01/index.html create mode 100644 26_weather_app_01/style.css diff --git a/26_weather_app_01/app.js b/26_weather_app_01/app.js new file mode 100644 index 0000000..c37e610 --- /dev/null +++ b/26_weather_app_01/app.js @@ -0,0 +1,17 @@ +console.log("Hello ji"); + +const API_KEY = "6ccd8f24913d9b18f2facc7a2337add5"; + +async function showWeather() { + // let latitude = 15.3333; + // let longitude = 74.0833; + let city = "goa"; + + const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}&units=metric`); + + const data = await response.json(); + console.log("Weather data:-> " + data); + + let newPara = document.createElement('p'); + newPara.textContent = data +} \ No newline at end of file diff --git a/26_weather_app_01/index.html b/26_weather_app_01/index.html new file mode 100644 index 0000000..2796e8b --- /dev/null +++ b/26_weather_app_01/index.html @@ -0,0 +1,12 @@ + + + + + + Weather App (API Based) + + + + + + \ No newline at end of file diff --git a/26_weather_app_01/style.css b/26_weather_app_01/style.css new file mode 100644 index 0000000..e69de29