You've already forked wakapi-readme-stats
Merge pull request #357 from anmol098/fix/private_user_profile_short_info_hidden
Private profile info hidden
This commit is contained in:
8
main.py
8
main.py
@@ -442,10 +442,10 @@ def get_short_info(github):
|
|||||||
else:
|
else:
|
||||||
disk_usage = humanize.naturalsize(user_info.disk_usage)
|
disk_usage = humanize.naturalsize(user_info.disk_usage)
|
||||||
request = requests.get('https://github-contributions.vercel.app/api/v1/' + user_info.login)
|
request = requests.get('https://github-contributions.vercel.app/api/v1/' + user_info.login)
|
||||||
if request.status_code == 200:
|
if request.status_code == 200 and len(request.json()['years']) > 0:
|
||||||
data = request.json()
|
this_year_data = request.json()['years'][0]
|
||||||
total = data['years'][0]['total']
|
total = this_year_data['total']
|
||||||
year = data['years'][0]['year']
|
year = this_year_data['year']
|
||||||
string += '> 🏆 ' + translate['Contributions in the year'] % (humanize.intcomma(total), year) + '\n > \n'
|
string += '> 🏆 ' + translate['Contributions in the year'] % (humanize.intcomma(total), year) + '\n > \n'
|
||||||
|
|
||||||
string += '> 📦 ' + translate["Used in GitHub's Storage"] % disk_usage + ' \n > \n'
|
string += '> 📦 ' + translate["Used in GitHub's Storage"] % disk_usage + ' \n > \n'
|
||||||
|
|||||||
Reference in New Issue
Block a user