#!/usr/bin/env python3
"""hc41: daftar SEMUA album Threads SS (carousel) + slug healthcare yang direferensikan."""
import json, re, sys
sys.path.insert(0, '/home/mantapman/.hermes/profiles/atun/workspace')
from repliz_client import ACC

docs = json.load(open('/tmp/repliz_all_20260919.json'))
alb = [d for d in docs if d.get('accountId') == ACC.STUDIOSOFT_THREADS and (d.get('type') or '') == 'album']
alb.sort(key=lambda d: (d.get('scheduleAt') or ''))
print("TOTAL album Threads SS:", len(alb))
for d in alb:
    desc = (d.get('description') or '')
    urls = re.findall(r'https?://(?:www\.)?studiosoft\.id/[^\s\)\]"\']+', desc)
    title = (d.get('title') or '')[:60]
    print("%s | %-8s | %-60s | %s" % ((d.get('scheduleAt') or '')[:16], (d.get('status') or ''),
                                      title, ",".join(u.split('/')[-2] if u.endswith('/') else u.split('/')[-1] for u in urls[:2])))
