Rebuild admin.nomadro.com around community ops, add configurable free peeks instead of nav locks, humanize user copy, and harden UGC/liveness admin APIs with backup/self-test scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1005 B
Python
37 lines
1005 B
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
import urllib.request
|
|
|
|
login = json.loads(
|
|
urllib.request.urlopen(
|
|
urllib.request.Request(
|
|
"https://api.nomadro.com/api/admin/login",
|
|
data=json.dumps(
|
|
{"username": "hackrobot", "password": "Xiao4669805@"}
|
|
).encode(),
|
|
headers={"content-type": "application/json"},
|
|
),
|
|
timeout=20,
|
|
).read()
|
|
)
|
|
tok = login["token"]
|
|
for p in (
|
|
"liveness",
|
|
"reports",
|
|
"coffee-bookings",
|
|
"meetup-reviews",
|
|
"trips",
|
|
"blocks",
|
|
"files",
|
|
):
|
|
req = urllib.request.Request(
|
|
f"https://api.nomadro.com/api/admin/social/ugc/{p}?limit=5",
|
|
headers={"Authorization": f"Bearer {tok}"},
|
|
)
|
|
try:
|
|
with urllib.request.urlopen(req, timeout=20) as r:
|
|
d = json.loads(r.read())
|
|
print(p, r.status, "total=", d.get("total"), "items=", len(d.get("items") or []))
|
|
except Exception as e:
|
|
print(p, getattr(e, "code", None), e)
|