Files
foodlinkk-command-center/scripts/marketing_publish_due.py
T
Aissa 22a17ed048 Activate agent mesh with honest live status and working animations.
Souls now aggregate aliased events (e.g. halal_engine), KPIs reflect 6h activity, active agents animate, and morning scheduler/scripts target cockpit :8610.
2026-08-01 17:59:32 +00:00

38 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python3
"""Publish due scheduled social posts."""
from __future__ import annotations
import json
import sys
import urllib.request
COCKPIT_URL = "http://127.0.0.1:8610"
TOOLS_URL = "http://127.0.0.1:8700"
def main() -> int:
try:
req = urllib.request.Request(
f"{COCKPIT_URL}/api/admin/scheduled-posts/publish-due",
data=b"{}",
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req, timeout=120) as resp:
data = json.loads(resp.read().decode("utf-8"))
print(json.dumps(data))
return 0
except urllib.error.HTTPError as exc:
if exc.code == 404:
print("publish-due endpoint not yet available — skipped")
return 0
print(f"publish failed: {exc}", file=sys.stderr)
return 1
except Exception as exc:
print(f"publish failed: {exc}", file=sys.stderr)
return 1
if __name__ == "__main__":
raise SystemExit(main())