#!/usr/bin/env python3
"""DMark: periksa tag judul kutipan utuh di HTML tersaji — ada jejak font-size:17px (tanda suntingan saya masuk)?"""
import re, urllib.request

UA = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/124.0 Safari/537.36"}
h = urllib.request.urlopen(urllib.request.Request("https://www.dmark.id/", headers=UA), timeout=90).read().decode("utf-8", "replace")

pos = h.find("Creativity is Intelegence")
print("=== tag judul kutipan di HTML tersaji ===")
potongan = h[max(0, pos - 700):pos + 60]
for baris in re.split(r">\s*<", potongan)[-6:]:
    print("   " + re.sub(r"\s+", " ", baris)[:300])

print("\n=== jejak font-size 17px di seluruh halaman ===")
print("   'font-size:17px':", len(re.findall(r"font-size:\s*17px", h)))
print("   'font-size: 17px':", len(re.findall(r"font-size:\s*17px", h, re.I)))
print("   '--spectra-text-color: ast-global-color-5':", len(re.findall(r"--spectra-text-color:\s*ast-global-color-5", h)))

print("\n=== apakah blok kutipan sudah h2 di HTML? ===")
print("   <h2 ...>Creativity:", bool(re.search(r"<h2[^>]*>\s*Creativity", h)))
print("   <h5 ...>Creativity:", bool(re.search(r"<h5[^>]*>\s*Creativity", h)))

print("\n=== waktu pembuatan cache (jejak WP Rocket) ===")
for m in re.findall(r"(?:cached|Cached)[^\n]{0,90}", h)[:3]:
    print("   " + m[:110])
for m in re.findall(r"<!--[^>]{0,120}(?:WP Rocket|rocket)[^>]{0,120}-->", h, re.I)[:3]:
    print("   " + re.sub(r"\s+", " ", m)[:140])
