-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_user.py
29 lines (26 loc) · 1.02 KB
/
get_user.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import requests
username = input("GitHub Username: ")
r = requests.get(f"https://api.github.com/users/{username}")
if r.status_code == 200:
r = r.json()
print("User ID: " + str(r["id"]))
print("Node ID: " + str(r["node_id"]))
print("Avatar URL: " + str(r["avatar_url"]))
print("Type: " + str(r["type"]))
print("Site Admin: " + str(r["site_admin"]))
print("Name: " + str(r["name"]))
print("Company: " + str(r["company"]))
print("Website: " + str(r["blog"]))
print("Location: " + str(r["location"]))
print("Email: " + str(r["email"]))
print("Hireable: " + str(r["hireable"]))
print("Bio: " + str(r["bio"]))
print("Twitter: " + str(r["twitter_username"]))
print("Repo Count: " + str(r["public_repos"]))
print("Gist Count: " + str(r["public_gists"]))
print("Followers: " + str(r["followers"]))
print("Following: " + str(r["following"]))
print("Created At: " + str(r["created_at"]))
print("Updated At: " + str(r["updated_at"]))
else:
print("Invalid Username")