fixes calendar url issue
This commit is contained in:
17
gitfiti.py
17
gitfiti.py
@ -170,13 +170,20 @@ def load_images(img_names):
|
|||||||
|
|
||||||
def get_calendar(username, base_url='https://github.com/'):
|
def get_calendar(username, base_url='https://github.com/'):
|
||||||
"""retrieves the github commit calendar data for a username"""
|
"""retrieves the github commit calendar data for a username"""
|
||||||
url = base_url + 'users/' + username + '/contributions_calendar_data'
|
base_url = base_url + 'users/' + username
|
||||||
try:
|
try:
|
||||||
|
url = base_url + '/contributions'
|
||||||
page = urllib2.urlopen(url)
|
page = urllib2.urlopen(url)
|
||||||
except (urllib2.HTTPError,urllib2.URLError) as e:
|
except (urllib2.HTTPError,urllib2.URLError) as e:
|
||||||
print "There was a problem fetching data from {0}".format(url)
|
print ("There was a problem fetching data from {0}".format(url))
|
||||||
print e
|
print (e)
|
||||||
raise SystemExit
|
try:
|
||||||
|
url = base_url + '/contributions_calendar_data'
|
||||||
|
page = urllib2.urlopen(url)
|
||||||
|
except (urllib2.HTTPError,urllib2.URLError) as e:
|
||||||
|
print ("There was a problem fetching data from {0}".format(url))
|
||||||
|
print (e)
|
||||||
|
raise SystemExit
|
||||||
return json.load(page)
|
return json.load(page)
|
||||||
|
|
||||||
def max_commits(input):
|
def max_commits(input):
|
||||||
|
Reference in New Issue
Block a user