Is there a way to set things up so it will only try to get information once a day at midnight- even when no one has the website open?
Yes you could create a cron task to fetch the information once per night, and then users could get that data from you. This would require the ability to run a task on your server.
Also, I'm hosted by Github pages.
So no, you can't use a cron task. Instead, you could cache the response in the client's cookies or local storage and have it expire in 24 hours. This way each client will check their local cache first, and only fetch if the cache is expired.
last dying breath option:
You could setup a crontask on your development machine to fetch the weather, write it to a file, then push a commit to github, and have it run that task once per night. Then users could fetch the static data from GH Pages.
This may be a bit overkill tho