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

Badge Request: crates.io total downloads of an author #10614

Closed
Nugine opened this issue Oct 16, 2024 · 2 comments
Closed

Badge Request: crates.io total downloads of an author #10614

Nugine opened this issue Oct 16, 2024 · 2 comments
Assignees
Labels
good first issue New contributors, join in! service-badge New or updated service badge

Comments

@Nugine
Copy link

Nugine commented Oct 16, 2024

📋 Description

This badge shows the total downloads of all the crates that an author publishs.

Static Badge

🔗 Data

https://crates.io/api/v1/users/{user_id}/stats
It is a public API.

Example: https://crates.io/api/v1/users/3618/stats

{"total_downloads":6096699151}

🎤 Motivation

Showing that this crate author is trustworthy because of high total downloads.

@Nugine Nugine added the service-badge New or updated service badge label Oct 16, 2024
@Nugine Nugine changed the title crates.io total downloads of an author Badge Request: crates.io total downloads of an author Oct 16, 2024
@calebcartwright
Copy link
Member

Sounds reasonable, especially since there's already an API for it. I wouldn't personally conflate download numbers as inherently implying trust, but certainly seems like a badge we can incorporate if someone is willing to work on it.

@calebcartwright calebcartwright added the good first issue New contributors, join in! label Oct 16, 2024
@jNullj jNullj self-assigned this Oct 17, 2024
jNullj added a commit to jNullj/shields-fun-fork that referenced this issue Oct 17, 2024
jNullj added a commit to jNullj/shields-fun-fork that referenced this issue Oct 17, 2024
This commit adds the CratesUserDownloads service and tester files. The CratesUserDownloads service shows the user total downloads at Crates.io.

as requested by badges#10614
github-merge-queue bot pushed a commit that referenced this issue Oct 20, 2024
* add jsdoc for crates fetch func

* add BaseCratesUserService for user stats api route

part of solution for #10614

* Add CratesUserDownloads service and tester

This commit adds the CratesUserDownloads service and tester files. The CratesUserDownloads service shows the user total downloads at Crates.io.

as requested by #10614

* render userid in code block

* add non-exsistent user CratesUserDownloads test

userid for API usage is int32, therefor to minimize chance of user taking the id used the max value for int32 is used.

* fixed typo
@chris48s
Copy link
Member

#10619

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

No branches or pull requests

4 participants