From d457ac8e05be5c904704d819668859f12e21ec6d Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Sat, 23 Sep 2017 10:12:51 -0700 Subject: Fix download count script. Note that it only counts after the projects was renamed to "Inter" --- misc/download-count.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'misc/download-count.py') 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) -- cgit v1.2.3