feat(fuenfvoracht): Schreibstil heute/morgen im Tages-Briefing

Bot fragt CT109 /api/auto5vor8/style-preview ab und zeigt den
rotierenden Auto-5vor8-Stil (heute/morgen) im 15-Uhr-Briefing an.
This commit is contained in:
Homelab Cursor 2026-07-31 22:34:53 +02:00
parent 668055d260
commit b704a5949a

View file

@ -359,6 +359,20 @@ async def job_check_notify(bot: Bot):
flog.info('article_auto_approved', date=d, post_time=pt)
def _fetch_style_preview():
"""Holt heutigen/morgigen 5vor8-Schreibstil von rss-manager (CT109)."""
try:
req = urllib.request.Request(
"http://10.10.10.109:8080/api/auto5vor8/style-preview",
headers={"User-Agent": "fuenfvoracht-briefing/1.0"},
)
with urllib.request.urlopen(req, timeout=5) as resp:
import json
return json.loads(resp.read().decode("utf-8"))
except Exception:
return None
async def job_morning_briefing(bot: Bot):
"""Morgen-Briefing: was ist heute geplant, was fehlt."""
d = today_str()
@ -408,6 +422,13 @@ async def job_morning_briefing(bot: Bot):
lines.append(f"\n📆 <b>Nächste 3 Tage:</b>")
lines.extend(plan_lines)
style_preview = _fetch_style_preview()
if style_preview:
lines.append(f"\n🎨 <b>Schreibstil Auto-5vor8:</b>")
lines.append(f" Heute: {style_preview[today][style]}")
lines.append(f" Morgen: {style_preview[tomorrow][style]}")
lines.append(f"\n👉 https://fuenfvoracht.orbitalo.net")
await notify_reviewers(bot, '\n'.join(lines))