#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Sebaran jadwal link mati per tanggal + per URL."""
import json, collections, datetime
d = json.load(open("/tmp/link_mati.json"))
LIVE = {
    "https://studiosoft.id/marketing-industri": "2026-10-05",
    "https://studiosoft.id/digital-marketing-properti": "2026-10-06",
    "https://studiosoft.id/seo-properti": "2026-10-07",
    "https://studiosoft.id/marketing-manufaktur": "2026-10-08",
    "https://studiosoft.id/digital-marketing-retail": "2026-10-09",
    "https://studiosoft.id/strategi-pemasaran-properti": "2026-10-10",
    "https://studiosoft.id/marketing-keuangan": "2026-10-11",
    "https://studiosoft.id/promosi-apartemen-media-sosial": "2026-10-12",
    "https://studiosoft.id/analitik-properti": "2026-10-13",
    "https://studiosoft.id/cara-memasarkan-properti-lead-lama": "2026-10-14",
}
tot = 0
for u, v in sorted(d.items(), key=lambda x: -x[1]["n"]):
    tgl = collections.Counter()
    akun = collections.Counter()
    for j in v["jadwal"]:
        tgl[(j["at"] or "")[:10]] += 1
        akun[j["akun"]] += 1
    tot += v["n"]
    print(f"\n[{v['kode']}] x{v['n']:3}  {u}")
    print("    akun:", dict(akun))
    print("    tgl :", dict(sorted(tgl.items())))
print("\nTOTAL entri:", tot)
