Cron package that syncs jobs from matrixhost portal API, schedules execution with timezone-aware timing, and posts results to Matrix rooms. Includes Brave Search, reminder, and browser scrape (placeholder) executors with formatter. 31 pytest tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
21 lines
557 B
Python
21 lines
557 B
Python
"""Simple reminder executor for cron jobs."""
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
async def execute_reminder(job: dict, send_text, **_kwargs) -> dict:
|
|
"""Post a reminder message to a Matrix room."""
|
|
config = job.get("config", {})
|
|
message = config.get("message", "")
|
|
target_room = job["targetRoom"]
|
|
|
|
if not message:
|
|
return {"status": "error", "error": "No reminder message configured"}
|
|
|
|
text = f"\u23f0 **{job['name']}:** {message}"
|
|
await send_text(target_room, text)
|
|
|
|
return {"status": "success"}
|