Created
February 5, 2015 16:50
-
-
Save groovecoder/ff8816caa8767606459d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from datetime import datetime | |
import urllib | |
import requests | |
def _parse_github_datetime(datetime_string): | |
return datetime.strptime(datetime_string, '%Y-%m-%dT%H:%M:%SZ') | |
if __name__ == '__main__': | |
params = {'state': 'all', | |
'per_page': 100} | |
all_pulls_url = '%s?%s' % ( | |
'https://api.github.com/repos/%s/%s/pulls' % ('mozilla', 'kuma'), | |
urllib.urlencode(params) | |
) | |
resp = requests.get(all_pulls_url) | |
all_pulls = resp.json() | |
for pull in all_pulls: | |
import ipdb; ipdb.set_trace() | |
created_at = _parse_github_datetime(pull['created_at']) | |
merged_at = _parse_github_datetime(pull['merged_at']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment