summaryrefslogtreecommitdiff
path: root/misc/download-count.py
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2017-09-23 20:12:51 +0300
committerRasmus Andersson <rasmus@notion.se>2017-09-23 20:12:51 +0300
commitd457ac8e05be5c904704d819668859f12e21ec6d (patch)
tree61f0005160749f198be4082ad97d8d0f3cbfb7a3 /misc/download-count.py
parent1d2ddfc8259c0a8d955fabf56c368b69e01cab21 (diff)
downloadinter-d457ac8e05be5c904704d819668859f12e21ec6d.tar.xz
Fix download count script. Note that it only counts after the projects was renamed to "Inter"
Diffstat (limited to 'misc/download-count.py')
-rwxr-xr-xmisc/download-count.py11
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)