This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fea6531
commit 1f363f3
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<!-- Script Written December 26th 2023 --> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<meta name="viewport" content="", initial scale=1.0"></meta> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>TWC Api Script</title> | ||
</head> | ||
<body> | ||
<script> | ||
const api_url = 'https://api.weather.com/v1/geocode/38.8034059/-76.9052484/forecast/nowcast.json?language=en-US&units=e&apiKey=e1f10a1e78da46f5b10a1e78da96f525' | ||
async function getWx() { | ||
const response = await fetch(api_url); | ||
const data = await response.json(); | ||
console.log(data.latitude); | ||
const {forecast, narrative_512char, } = data; | ||
console.log(narrative_512char); | ||
|
||
document.getElementById('wx').textContent = forecast.narrative_512char; | ||
|
||
} | ||
|
||
getWx(); | ||
|
||
</script> | ||
<h1>Today:</h1> | ||
<h5 id="wx">The Forecast is unavaliable ;(</h5> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |