Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add homebrew download stats #6190

Closed
kdheepak opened this issue Feb 18, 2021 · 2 comments · Fixed by #6209
Closed

Add homebrew download stats #6190

kdheepak opened this issue Feb 18, 2021 · 2 comments · Fixed by #6209
Labels
good first issue New contributors, join in! service-badge New or updated service badge

Comments

@kdheepak
Copy link
Contributor

📋 Description

  • Which service is this badge for: Homebrew
  • What sort of information should this badge show?: Download stats
    Provide an example in plain text e.g: "downloads | 1200/year"

🔗 Data

Where can we get the data from?

🎤 Motivation

Please explain why this feature should be implemented and how it would be used.

  • What is the specific use case?

It would be nice to show download stats from homebrew, similar to how we can now show download stats from github releases.

@kdheepak kdheepak added the service-badge New or updated service badge label Feb 18, 2021
@calebcartwright
Copy link
Member

I'm having a bit of deja vu with this request, though can't seem to find any issues where we've discussed it previously.

We wouldn't want to use https://formulae.brew.sh/api/formula.json as that's way too big and takes way too long to retrieve, but i guess we could look at the analytics.install fields in the formula-specific api response (which is what we use for the version badges) to get the raw data.

This would be a relatively easy badge to add, and would recommend anyone interested in implementing take a look at our tutorial as well as the existing homebrew version badge code for reference. Note it might be beneficial to extract the common bits out (like the fetch function) into a separate helpers file or a base class that the existing version badge and future downloads badge could extend

@kdheepak
Copy link
Contributor Author

Thanks for the comment! I submitted a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge New or updated service badge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants