|
|
@@ -11,7 +11,7 @@ import simplejson as json
|
|
|
########################
|
|
|
|
|
|
API_BASE_URL = 'https://api.github.com/'
|
|
|
-API_USERS_URL = API_BASE_URL + 'users/DrkSephy'
|
|
|
+API_USERS_URL = API_BASE_URL + 'users/DrkSephy' + '?client_id=2404a1e21aebd902f6db' + '&client_secret=3da44769d4b7c9465fa4c812669148a163607c23'
|
|
|
|
|
|
# Endpoint to get statistics in a repository
|
|
|
# https://api.github.com/repos/DrkSephy/WaterEmblem/stats/contributors
|
|
|
@@ -38,13 +38,24 @@ def getUserData():
|
|
|
|
|
|
|
|
|
def getUserRepositories():
|
|
|
- req = requests.get(API_USERS_URL + '/repos')
|
|
|
+ pageNumber = 1
|
|
|
+ firstUrl = API_USERS_URL + '/repos' + '?page=' + str(pageNumber) + '&client_id=2404a1e21aebd902f6db' + '&client_secret=3da44769d4b7c9465fa4c812669148a163607c23'
|
|
|
+ urls = []
|
|
|
+ urls.append(firstUrl)
|
|
|
jsonList = []
|
|
|
- jsonList.append(json.loads(req.content))
|
|
|
repositories = []
|
|
|
- for data in jsonList:
|
|
|
- for datum in data:
|
|
|
- repositories.append(datum['name'])
|
|
|
+ while True:
|
|
|
+ req = requests.get(API_USERS_URL + '/repos' + '?page=' + str(pageNumber) + '&client_id=2404a1e21aebd902f6db' + '&client_secret=3da44769d4b7c9465fa4c812669148a163607c23')
|
|
|
+ jsonList.append(json.loads(req.content))
|
|
|
+ for data in jsonList:
|
|
|
+ for datum in data:
|
|
|
+ if len(datum) < 30:
|
|
|
+ print 'hello'
|
|
|
+ break
|
|
|
+ elif len(datum) >= 30:
|
|
|
+ pageNumber += 1
|
|
|
+ urls.append(API_USERS_URL + '/repos' + '?page=' + str(pageNumber) + '&client_id=2404a1e21aebd902f6db' + '&client_secret=3da44769d4b7c9465fa4c812669148a163607c23')
|
|
|
+ print urls
|
|
|
|
|
|
return repositories
|
|
|
|