github-release-stats
github-release-stats copied to clipboard
wrong total download count if more than 100 releases
hi,
i think the total download count shown is wrong, due to the api not responding with the full sets of releases. If a project has more than 100 releases, the api needs additional parameter for paginated results, example:
$ curl -s https://api.github.com/repos/abbbi/virtnbdbackup/releases | jq .[].name | wc -l
30
$ curl -s https://api.github.com/repos/abbbi/virtnbdbackup/releases?per_page=1000 | jq .[].name | wc -l
100
$ curl -s https://api.github.com/repos/abbbi/virtnbdbackup/releases?per_page=1000 | egrep 'download_count' | cut '-d:' -f 2 | sed 's/,/+/' | xargs echo | xargs -I N echo N 0 | bc
2292
$ curl -s https://api.github.com/repos/abbbi/virtnbdbackup/releases | egrep 'download_count' | cut '-d:' -f 2 | sed 's/,/+/' | xargs echo | xargs -I N echo N 0 | bc
1744