Skip to content

Commit ff41eac

Browse files
authored
Merge pull request #26 from Akasurde/patch-1
Update github.py
2 parents 82c48c7 + 0296c79 commit ff41eac

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

plugins/github.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import requests
22
import json
3+
import os
4+
35

46
list_of_pull_requests=[]
7+
58
def get_pull_requests(username,repository):
6-
r=requests.get("https://api.github.com/repos/"+username+"/"+repository+"/pulls")
7-
js=json.loads(r.content)
8-
for i in range(0,len(js)):
9-
if 'title' in js[i].keys():
9+
github_url = "https://api.github.com"
10+
r = requests.get(os.path.join(github_url, "repos", username, repository, "pulls"))
11+
js = json.loads(r.content)
12+
for i in range(0, len(js)):
13+
if 'title' in js[i].keys():
1014
list_of_pull_requests.append(js[i]['title'])
1115
return list_of_pull_requests
12-
13-
14-
#print get_pull_requests(username,repository)

0 commit comments

Comments
 (0)