Add weather caching, useless-tip redirect, clock widget, and IAM Bedrock auth
- Cache the latest fetched tomorrow weather and expose it via /api/system/weather/latest - Add a header Clock widget showing date/time plus the cached weather summary - Redirect useless-talk mentions from the weather bot to the useless-tips webhook - Switch Bedrock auth from bearer token to standard IAM access key/secret Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""直近で取得した「明日の天気」データをメモリ上にキャッシュする。"""
|
||||
from datetime import datetime
|
||||
|
||||
_latest: dict | None = None
|
||||
|
||||
|
||||
def set_latest(weather: str, pop: int | None, judgement: str, reason: str) -> None:
|
||||
global _latest
|
||||
_latest = {
|
||||
"weather": weather,
|
||||
"pop": pop,
|
||||
"judgement": judgement,
|
||||
"reason": reason,
|
||||
"fetched_at": datetime.now().isoformat(),
|
||||
}
|
||||
|
||||
|
||||
def get_latest() -> dict | None:
|
||||
return _latest
|
||||
Reference in New Issue
Block a user