Files
aza/AzA march 2026/hetzner_diag_wp_routes_subscription.py
2026-05-20 00:09:28 +02:00

29 lines
685 B
Python

#!/usr/bin/env python3
import json
import requests
BASE = "https://aza-medwork.ch"
HDR = {
"User-Agent": "Mozilla/5.0 (compatible; AZA-WooDiagnostic/1.0)",
"Accept": "application/json",
}
def main() -> None:
r = requests.get(BASE + "/wp-json", headers=HDR, timeout=20)
print("wp_json_http", r.status_code)
try:
j = r.json()
except Exception:
print("parse_fail")
return
routes = j.get("routes") or {}
hits = [k for k in routes if "subscription" in k.lower()]
print("route_keys_with_subscription_substr_count", len(hits))
for k in sorted(hits)[:15]:
print("route_key", k)
if __name__ == "__main__":
main()