16 lines
813 B
Python
16 lines
813 B
Python
import requests
|
|
|
|
tok = open(r"C:/Users/User/Desktop/keyhunter/gh_tokens.txt").readline().strip()
|
|
r = requests.get("https://api.github.com/gists/public",
|
|
params={"per_page": 100, "page": 1},
|
|
headers={"Authorization": f"Bearer {tok}",
|
|
"User-Agent": "keyfarm",
|
|
"Accept": "application/vnd.github+json"},
|
|
timeout=20)
|
|
print("status:", r.status_code)
|
|
j = r.json() if r.headers.get("content-type", "").startswith("application/json") else None
|
|
print("type:", type(j).__name__, "len:", len(j) if isinstance(j, list) else j)
|
|
if isinstance(j, list) and j:
|
|
g = j[0]
|
|
print("first:", g.get("id"), "files:", list((g.get("files") or {}).keys())[:3])
|
|
print("ratelimit remaining:", r.headers.get("x-ratelimit-remaining")) |