Today I Learned
Search…
Get total download stats from GitHub & Homebrew
Posted on 03 Jun, 2022

Get 365 download stats from homebrew

curl -sq https://formulae.brew.sh/api/formula/ugit.json | jq '.analytics.install_on_request."365d".ugit'

Get all download count from github api

(curl -sq https://api.github.com/repos/Bhupesh-V/ugit/releases | jq .[].assets[0].download_count | tr "\012" "+" ; echo "0") | bc

Combining both results

(curl -sq https://formulae.brew.sh/api/formula/ugit.json | jq '.analytics.install_on_request."365d".ugit' | tr "\012" "+" && (curl -sq https://api.github.com/repos/Bhupesh-V/ugit/releases | jq .[].assets[0].download_count | tr "\012" "+" ; echo "0")) | bc
Copy link
Edit on GitHub
On this page
Get 365 download stats from homebrew
Get all download count from github api
Combining both results