Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin for GitHub #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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