stevenson-space / shs

Beautiful and practical agenda management tool for SHS students
https://stevenson.space
GNU General Public License v3.0
10 stars 16 forks source link

Idea: Weather tab #164

Closed Aaaaa501 closed 1 year ago

Aaaaa501 commented 1 year ago

A card with current day's weather and maybe links to a page with more detailed weather

yvvijay121 commented 1 year ago

This would likely rely on the weather API that is used, and hopefully, some type of open-source, free-to-use API can be used (easier, less of a headache, etc.). Just found this open-source weather API, but if that doesn't work, the National Weather Service should work instead (however, this only returns Chicago data, so may be inaccurate at times).

JosephShepin commented 1 year ago

There is also openweathermap which has a very generous free tier for educational purposes. I had actually looked at making a weather card about 4 years ago using it.

Aaaaa501 commented 1 year ago

There are a lot of free apis, but the main problem I see is that because the school to my knowledge uses a subnet mask, it might be rate limited if we call it each time the website is opened. It might be better if we can cache the data, either on a backend or another website where we can upload the data and call it more frequently.

aw-0 commented 1 year ago

Here's an idea: We can set up a Github Action to run daily and fetch the weather in Lincolnshire, and create a new commit with something like a weather.json file that contains the API's response. Then we just serve the weather.json file statically, which will resolve our issue of rate limits, API key security, and of needing to build a backend.

JosephShepin commented 1 year ago

yeah I like that. We already have a hook that rebuilds the project every day - that's how the events tab stays updated. We could just add the weather script into the utils folder and throw it into a json file.