Commit graph

34 commits

Author SHA1 Message Date
feaefba03c Limit weather API calls to cron only, increase cache TTL to 24h
Web view was calling the OpenWeatherMap API directly on every request
(home + all trip locations), causing >1000 calls/day. Now web_view.py
uses cache_only=True everywhere so it never triggers live API calls —
update.py (cron) is the sole API caller. Also warms home location cache
in update_weather(), and increases TTL from 6h to 24h.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 09:27:56 +00:00
04cb3e8179 Add 2-hour TTL cache check to SpaceDevs launch updater
Prevents hitting the SpaceDevs rate limit by skipping the API call
when the launches cache is still fresh (< 2 hours old), matching the
same TTL pattern already used for the active crewed flights cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 13:28:10 +00:00
9f881d7177 Fix SpaceDevs rate-limiting and cache corruption from throttled responses
Don't write rate-limit/error responses to disk in next_launch_api_data,
so they can't become the "most recent" cache file and cause KeyError crashes
in read_cached_launches. Add defensive results-list checks in
read_cached_launches and get_launches to handle any existing bad files.

Drop refresh=True from the updater's get_active_crewed_flights call so the
2-hour TTL applies; the paginated spacecraft/flight crawl was running on
every hourly cron job and likely causing the burst that triggered throttling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 20:50:05 +00:00
b4f0a5bf5d Add OpenWeatherMap weather forecasts. Closes #48
Show 8-day Bristol home weather on the index and weekends pages.
Show destination weather per day on the trip list and trip page.
Cache forecasts in ~/lib/data/weather/ and refresh via update.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 20:27:25 +00:00
61e17d9c96 Track dates of English school holidays
Fixes #168
2026-02-21 18:05:19 +00:00
7a50ea6016 Improve launch status UI and alert on SpaceDevs payload errors 2026-02-21 16:39:47 +00:00
458dfc5136 Refresh active crewed mission cache in updater
Closes #175
2026-02-21 16:08:45 +00:00
09eb44b55d Send alerts for all space launch test flights
In addition to the configured FOLLOW_LAUNCHES, also send emails for any
launch whose mission.type == "Test Flight" even if its slug is not in
FOLLOW_LAUNCHES.

Fixes #192.
2025-08-12 23:23:29 +01:00
97c0531a22 Send at most one grouped birthday reminder email
Collects birthdays in the next 7 days, groups them into sections
(Today/Tomorrow/In N days), and sends a single email.

Fixes #201.
2025-08-12 22:33:52 +01:00
fd7488bd04 Move format_launch_changes to agenda.thespacedevs 2025-08-12 10:59:56 +01:00
bcb3329fdd Add birthday email reminder functionality
Implements birthday reminder emails that are sent daily at 9 AM for birthdays
occurring within the next 7 days. Integrates with existing birthday.py module
and mail system to send notifications with appropriate timing-based subjects.

Fixes #171

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 12:24:09 +02:00
220256dd91 Better space launch mail after space launch
Fixes #176.
2025-07-15 17:33:08 +02:00
1806785700 Improve space launch change email format for better readability
Replace technical YAML diff output with human-readable bullet points that clearly explain what changed. Added structured email format with mission details, rocket emoji, and formatted dates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 17:06:12 +02:00
59236d3ace TODO: debug why update gandi fails 2025-06-04 22:24:04 -05:00
9bdf21ea5b No need to 'type: ignore' on deepdiff. 2025-05-26 10:08:05 -05:00
9a204d8526 Send mail with HTML if GWR advance ticket page not parsable 2024-11-18 16:02:17 +00:00
67b1adf956 More support for offline_mode 2024-11-04 09:59:55 +00:00
5f13bff9bd Better space launch change email 2024-10-12 14:00:58 +01:00
488ecf8b71 GWR ticket date mail shows weekends
GWR advance ticket change email now shows Saturdays and Sundays in
addition to Weekdays.

Switched from ISO dates to human readable dates.

Closes: #177
2024-09-23 09:22:20 +01:00
20e8515bb7 Sometimes the diff includes Python types 2024-09-09 19:16:21 +01:00
5c4eac60ee Adjust bristol waste function names 2024-07-14 23:10:00 +08:00
0f3f596cb3 Split waste_schedule.py in two 2024-07-14 22:19:13 +08:00
b38ec99628 Show changes in launch JSON 2024-07-09 08:22:48 +01:00
d1898686e9 Catch and ignore space launch API errors 2024-07-09 08:22:33 +01:00
07cf7dee3c Watch for new upcoming geomob events and announce 2024-07-08 11:49:50 +01:00
ff51bb9ff9 Move send_mail() to own module 2024-07-08 10:44:39 +01:00
b8ed1d5d65 Handle missing space launch 2024-06-26 08:48:58 +01:00
e400360697 Send alert emails for particular rocket launches
Closes: #156
2024-06-15 21:35:18 +01:00
dbc12adb3d Rewrite update code to use flask app_context() 2024-04-20 07:52:00 +01:00
66ca6c0744 Get more exchange rates 2024-04-18 22:26:04 +01:00
f0c28d2440 Download domain info from gandi 2024-03-30 19:32:05 +00:00
422cd8aa9d Use gandi API to get domain renewal dates
Closes: #134
2024-03-27 17:47:48 +00:00
1e90df76dd Bug fix 2024-03-27 16:38:22 +00:00
a37af733cd Combine cron update scripts into one script
Closes: #135
2024-03-05 10:26:54 +01:00