17 lines
468 B
Python
17 lines
468 B
Python
import requests
|
|
import json
|
|
import urllib3
|
|
urllib3.disable_warnings()
|
|
|
|
headers = {"User-Agent": "Mozilla/5.0"}
|
|
|
|
for ep in ["kubernetes", "longhorn"]:
|
|
url = f"https://homepage.snarfnet.net/api/widgets/{ep}"
|
|
try:
|
|
r = requests.get(url, headers=headers, verify=False, timeout=10)
|
|
print(f"=== {ep} (status {r.status_code}) ===")
|
|
print(json.dumps(r.json(), indent=2)[:500])
|
|
except Exception as e:
|
|
print(f"=== {ep} ERROR ===", e)
|
|
|