Extended Github API request calls with ID+Secret
This commit is contained in:
parent
f0031dca16
commit
58ee4f4da5
1 changed files with 5 additions and 3 deletions
|
@ -1,21 +1,23 @@
|
||||||
__author__ = 'sagi'
|
__author__ = 'sagi'
|
||||||
import requests
|
import requests
|
||||||
|
from GithubAPI.GithubAPI import GitHubAPI_Keys
|
||||||
|
|
||||||
|
githubKeys = GitHubAPI_Keys()
|
||||||
|
|
||||||
def get_repo_general_info(repo_url):
|
def get_repo_general_info(repo_url):
|
||||||
url = 'https://api.github.com/repos/' + repo_url
|
url = 'https://api.github.com/repos/' + repo_url + '?client_id='+githubKeys.getId()+'&client_secret=' + githubKeys.getSecret()
|
||||||
req = requests.get(url)
|
req = requests.get(url)
|
||||||
return req.json()
|
return req.json()
|
||||||
|
|
||||||
|
|
||||||
def get_repo_stats(repo_url):
|
def get_repo_stats(repo_url):
|
||||||
url = 'https://api.github.com/repos/' + repo_url + '/stats/contributors'
|
url = 'https://api.github.com/repos/' + repo_url + '/stats/contributors' + '?client_id='+githubKeys.getId()+'&client_secret=' + githubKeys.getSecret()
|
||||||
req = requests.get(url)
|
req = requests.get(url)
|
||||||
return req.json()
|
return req.json()
|
||||||
|
|
||||||
|
|
||||||
def get_repo_issues(repo_url):
|
def get_repo_issues(repo_url):
|
||||||
url = 'https://api.github.com/repos/' + repo_url + '/issues'
|
url = 'https://api.github.com/repos/' + repo_url + '/issues' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret()
|
||||||
req = requests.get(url)
|
req = requests.get(url)
|
||||||
return req.json()
|
return req.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue