Skip to content

Instantly share code, notes, and snippets.

@ablwr
Created May 5, 2020 23:33
Show Gist options
  • Save ablwr/65516cd54e84b19e31ab9fad683cc448 to your computer and use it in GitHub Desktop.
Save ablwr/65516cd54e84b19e31ab9fad683cc448 to your computer and use it in GitHub Desktop.
weatherInCascadiaNow
let weatherInCascadiaNow = async function getWeather() {
return fetch('https://api.weather.gov/gridpoints/SEW/121,70/forecast')
.then(response => response.json())
.then(data => {
return data.properties.periods[0].shortForecast
})
.then(output => document.getElementById('h1').innerHTML = output)
};
weatherInCascadiaNow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment