3 ms·
I usually check weather on forecast.gov website, with these bookmarked urls: https://forecast.weather.gov/MapClick.php?lat=40.7983&lon=-124.1673&unit=0&lg=engl
by davchana 4y ago
I usually check weather on forecast.gov website, with these bookmarked urls:
https://forecast.weather.gov/MapClick.php?lat=40.7983&lon=-124.1673&unit=0&lg=english&FcstType=text&TextType=1 https://forecast.weather.gov/MapClick.php?lat=40.7983&lon=-1...
The issue I had with these were that, these pages are always in desktop mode even on mobile. So i made a one page static website which takes & stores these urls in local storage, & fetches the one I click upon. On next pageload, it remebers the last loaded city & it loads it again.
All the page is in mobile-first view mode in css.
https://spa.bydav.in/weather/index.html https://spa.bydav.in/weather/index.html
You might see nothing as you need to preload/populate the local storage with either manually copied urls or simply paste this json.
[
{
"abb": "SNR",
"full": "Sonora",
"url": "https://forecast.weather.gov/MapClick.php?lat=37.98&lon=-120.38&unit=0&lg=english&FcstType=json&TextType=1"
},
{
"abb": "RDB",
"full": "Red Bluff",
"url": "https://forecast.weather.gov/MapClick.php?lat=40.1781&lon=-122.2354&unit=0&lg=english&FcstType=json&TextType=1"
},
{
"abb": "SFO",
"full": "San Francisco",
"url": "https://forecast.weather.gov/MapClick.php?lat=37.7771&lon=-122.4197&unit=0&lg=english&FcstType=json&TextType=1"
},
{
"abb": "ERK",
"full": "Eureka",
"url": "https://forecast.weather.gov/MapClick.php?lat=40.8033&lon=-124.1595&unit=0&lg=english&FcstType=json&TextType=1"
}
]