Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import os


list_of_pull_requests=[]
list_of_pull_requests = []


def get_pull_requests(username, repository):

def get_pull_requests(username,repository):
github_url = "https://api.github.com"
r = requests.get(os.path.join(github_url, "repos", username, repository, "pulls"))
r = requests.get(os.path.join(github_url, "repos", repository, "pulls"))
js = json.loads(r.content)
for i in range(0, len(js)):
if 'title' in js[i].keys():
list_of_pull_requests.append(js[i]['title'])
for pull in js:
if username == pull['user']['login']:
if 'title' in pull.keys():
list_of_pull_requests.append(pull['title'])
return list_of_pull_requests