Created
March 30, 2024 13:31
-
-
Save tomac4t/634f414c3bea49d72c4ece5bdb42d5d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# replace github personal token | |
ghp = 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxx' | |
username = 'JiaT75' | |
p = 0 | |
def event(p): | |
params = { | |
'per_page': '100', | |
'page': p, | |
} | |
headers = { | |
'Accept': 'application/vnd.github+json', | |
'X-GitHub-Api-Version': '2022-11-28', | |
'Authorization': 'Bearer ' + ghp, | |
} | |
response = requests.get('https://api.github.com/users/' + username + '/events', params=params, headers=headers) | |
json = response.json() | |
for i in range (0, len(json)): | |
print(json[i]["id"], json[i]["type"], json[i]["repo"]["name"], json[i]["created_at"], sep=',') | |
if len(json) < 100: | |
exit(0) | |
while True: | |
p = p + 1 | |
event(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@JiaT75's events: