Skip to content

Commit

Permalink
started 26_weather_app_01
Browse files Browse the repository at this point in the history
started api based 26_weather_app_01
  • Loading branch information
nitishkhobragade committed May 13, 2024
1 parent 07e1d23 commit c9aa70e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 26_weather_app_01/app.js
Original file line number Diff line number Diff line change
@@ -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
}
12 changes: 12 additions & 0 deletions 26_weather_app_01/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather App (API Based)</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<script src="./app.js"></script>
</body>
</html>
Empty file added 26_weather_app_01/style.css
Empty file.

0 comments on commit c9aa70e

Please sign in to comment.