File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 88
99GITHUB_RATE_LIMIT_ENDPOINT = "https://api.github.com/rate_limit"
1010GITHUB_REPOS_ENDPOINT = "https://api.github.com/user/repos?sort=created&per_page=100"
11+ GITHUB_EVENTS_ENDPOINT = "https://api.github.com/users/carolinux/events?sort=created&per_page=100" #FIXME, get username
12+
13+ GITHUB_EVENTS_ENDPOINT = "https://api.github.com/repos/anitagraser/TimeManager/commits?author=carolinux&per_page=100"
14+
15+ #https://api.github.com/repos/carolinux/Subs.py/commits?author=carolinux&per_page=100
16+ # also allows for a since param in the url
1117
1218
1319def get_auth_header (github_access_token ):
@@ -45,3 +51,22 @@ def get_user_repos(github_access_token):
4551 url = next ['url' ]
4652 #print("Called the api {} times".format(cnt))
4753 return results
54+
55+
56+ def get_user_events (github_access_token ):
57+ results = []
58+ cnt = 0
59+ url = GITHUB_EVENTS_ENDPOINT
60+ while (True ):
61+ cnt += 1
62+ response = requests .get (url , headers = get_auth_header (github_access_token ))
63+ results += json .loads (response .content )
64+ # if results['type'] == 'PushEvent'
65+ # results[0]['payload']['commits'][0]['message']
66+ next = response .links .get ('next' )
67+ if not next :
68+ break
69+ else :
70+ url = next ['url' ]
71+ #print("Called the api {} times".format(cnt))
72+ return results
You can’t perform that action at this time.
0 commit comments