Last active
April 26, 2024 05:06
-
-
Save fitsum/03ccf8b780a325f20d4c9a5347fa012b to your computer and use it in GitHub Desktop.
noaa.js
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
console.clear() | |
var latLon = '38.9031,-77.0507', | |
getForecastURL = 'https://api.weather.gov/points/' + latLon; | |
forecast = async (url) => { | |
//let r = await fetch(url); | |
let j = await (await fetch(url)).json(); | |
j.properties.forecast ? forecast(j.properties.forecast) : console.table(j.properties.periods) | |
} | |
forecast(getForecastURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forecast() fires twice
step 1: gets URL for area forecast req
step 2: parse response from req