mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-04-24 11:35:57 +02:00
362a6e2ceb
Former-commit-id: 8ed321f2ba
24 lines
756 B
Python
24 lines
756 B
Python
import json
|
|
import urllib.request
|
|
|
|
try:
|
|
data = json.loads(urllib.request.urlopen('http://localhost:8000/api/live-data').read())
|
|
|
|
tracked = data.get('tracked_flights', [])
|
|
colors = {}
|
|
for t in tracked:
|
|
c = t.get('alert_color', 'NONE')
|
|
colors[c] = colors.get(c, 0) + 1
|
|
print(f"TRACKED FLIGHTS: {len(tracked)} | Colors: {colors}")
|
|
|
|
ships = data.get('ships', [])
|
|
types = {}
|
|
for s in ships:
|
|
t = s.get('type', 'unknown')
|
|
types[t] = types.get(t, 0) + 1
|
|
print(f"SHIPS: {len(ships)} | Types: {types}")
|
|
|
|
print(f"NEWS: {len(data.get('news', []))} | EARTHQUAKES: {len(data.get('earthquakes', []))} | CCTV: {len(data.get('cctv', []))}")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|