#!/usr/bin/env python3 """ Fetch and display TIDY-CRE dashboard information. Usage: fetch_dashboard.py [host] [port] [timeout] """ import sys import urllib.request import urllib.error import json def fetch_dashboard(host: str, port: int, timeout: float): """Fetch the dashboard HTML and extract key info.""" url = f"http://{host}:{port}/" try: req = urllib.request.Request(url, method='GET') with urllib.request.urlopen(req, timeout=timeout) as response: html = response.read().decode('utf-8') print(f"[OK] Dashboard fetched from {url}") print(f" - Status: {response.status}") print(f" - Content-Type: {response.headers.get('Content-Type', 'unknown')}") print(f" - Content-Length: {len(html)} bytes") # Try to extract title import re title_match = re.search(r'