17 lines
721 B
Python
17 lines
721 B
Python
import requests
|
|
|
|
tok = open(r"C:/Users/User/Desktop/keyhunter/gh_tokens.txt").readline().strip()
|
|
H = {"Authorization": f"Bearer {tok}", "User-Agent": "keyfarm"}
|
|
|
|
r = requests.get("https://api.github.com/gists/public",
|
|
params={"per_page": 5, "page": 1}, headers=H, timeout=20)
|
|
gids = [g["id"] for g in r.json()[:5]]
|
|
print("gids:", gids)
|
|
for gid in gids:
|
|
r2 = requests.get(f"https://api.github.com/gists/{gid}", headers=H, timeout=20)
|
|
print(gid, "status:", r2.status_code)
|
|
if r2.status_code == 200:
|
|
j = r2.json()
|
|
for fn, m in (j.get("files") or {}).items():
|
|
c = m.get("content") or ""
|
|
print(f" {fn}: content_len={len(c)} truncated={m.get('truncated')}") |