Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created February 5, 2015 16:50
Show Gist options
  • Save groovecoder/ff8816caa8767606459d to your computer and use it in GitHub Desktop.
Save groovecoder/ff8816caa8767606459d to your computer and use it in GitHub Desktop.
#!/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