Merge pull request #3 from empathetic-alligator/master
Removed dependency on requests!
This commit is contained in:
11
gitfiti.py
11
gitfiti.py
@ -1,10 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import os, sys, datetime, math, itertools
|
import os, sys, datetime, math, itertools, urllib2, json
|
||||||
try:
|
|
||||||
import requests
|
|
||||||
except:
|
|
||||||
print 'the requests module is required'
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
title='''
|
title='''
|
||||||
'''
|
'''
|
||||||
@ -96,8 +91,8 @@ def get_calendar(username):
|
|||||||
"""retrieves the github commit calendar data for a username"""
|
"""retrieves the github commit calendar data for a username"""
|
||||||
BASEURL='https://github.com/'
|
BASEURL='https://github.com/'
|
||||||
url = BASEURL + 'users/' + username + '/contributions_calendar_data'
|
url = BASEURL + 'users/' + username + '/contributions_calendar_data'
|
||||||
req = requests.get(url)
|
page = urllib2.urlopen(url)
|
||||||
return req.json()
|
return json.load(page)
|
||||||
|
|
||||||
def max_commits(input):
|
def max_commits(input):
|
||||||
"""finds the highest number of commits in one day"""
|
"""finds the highest number of commits in one day"""
|
||||||
|
Reference in New Issue
Block a user