25 lines
679 B
Bash
25 lines
679 B
Bash
#!/bin/bash
|
|
TMP=$(mktemp)
|
|
curl -sk "https://weval-consulting.com/api/dashboards-registry.php" --max-time 10 > "$TMP"
|
|
python3 -c "
|
|
import json
|
|
from datetime import datetime, timezone
|
|
with open('$TMP') as f:
|
|
d = json.load(f)
|
|
now = datetime.now(timezone.utc)
|
|
recent = []
|
|
for e in d['dashboards']:
|
|
try:
|
|
mt = datetime.fromisoformat(e['mtime'])
|
|
h = (now - mt).total_seconds() / 3600
|
|
if h < 24:
|
|
recent.append((h, e['name'], e['category']))
|
|
except Exception:
|
|
pass
|
|
recent.sort()
|
|
print(f'Total: {len(d[\"dashboards\"])}, Modified <24h: {len(recent)}')
|
|
for h, n, c in recent[:15]:
|
|
print(f' [{h:5.1f}h] [{c}] {n}')
|
|
"
|
|
rm -f "$TMP"
|