2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-10 13:10:26 +00:00
cointop/meta/metrics/homebrew_metrics.py

14 lines
292 B
Python
Raw Normal View History

import requests
days = 30
# https://formulae.brew.sh/api/formula/cointop.json
url = f'https://formulae.brew.sh/api/analytics/install/{days}d.json'
r = requests.get(url)
data = r.json()
entry = [x for x in data['items'] if x['formula'] == 'cointop'][0]
total = entry['count']
print(total)