diff options
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/download-count.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/misc/download-count.py b/misc/download-count.py index 0908b334b..c70532490 100755 --- a/misc/download-count.py +++ b/misc/download-count.py @@ -3,14 +3,17 @@ from __future__ import print_function import os, sys, json, urllib2 -f = urllib2.urlopen('https://api.github.com/repos/rsms/interface/releases') +f = urllib2.urlopen('https://api.github.com/repos/rsms/inter/releases') releases = json.load(f) countTotal = 0 for release in releases: - count = release['assets'][0]['download_count'] - countTotal += count - print('%s: %d' % (release['tag_name'], count)) + if len(release['assets']) > 0: + count = release['assets'][0]['download_count'] + countTotal += count + print('%s: %d' % (release['tag_name'], count)) + else: + print('%s: (missing)' % release['tag_name']) print('Total: %d' % countTotal) |