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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modrinth #7078

Closed
NatoBoram opened this issue Sep 26, 2021 · 9 comments
Closed

Modrinth #7078

NatoBoram opened this issue Sep 26, 2021 · 9 comments
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs

Comments

@NatoBoram
Copy link

NatoBoram commented Sep 26, 2021

馃搵 Description

Service : https://modrinth.com

This is the kind of information that should be shown by the new badges

Screenshot 2021-09-26 at 14-29-30 Switcheroo - Modrinth

Example :

Modrinth Downloads

  • Modrinth
  • https://api.modrinth.com/api/v1/mod/wq6HaMZG
  • #5da426
  • downloads

馃敆 Data

https://github.com/modrinth/labrinth/wiki

https://api.modrinth.com/api/v1/mod/wq6HaMZG

馃帳 Motivation

In my case, I want to show off the downloads of my mod on a specific platform, Modrinth.

@NatoBoram NatoBoram added the service-badge Accepted and actionable changes, features, and bugs label Sep 26, 2021
@chris48s
Copy link
Member

I can't see any docs explicitly explaining rate limit. https://api.modrinth.com/ gives a documentation link https://modrinth.com/documentation but its a 404.

If I call curl "https://api.modrinth.com/api/v1/mod/wq6HaMZG" --include the headers include

x-ratelimit-limit: 200
x-ratelimit-remaining: 197
x-ratelimit-reset: 59

so it looks like anonymous usage is subject to some fairly restrictive rate limiting. Are you able to link to any docs about rate limits? I think if we were going to take on this integration we'd need to understand this constraint in more detail.

@NatoBoram
Copy link
Author

NatoBoram commented Sep 26, 2021

I think rate limits were added there:

But the only thing I found was that.

.wrap(Logger::new("%a %{User-Agent}i"))
.wrap(
	RateLimiter::new(MemoryStoreActor::from(store.clone()).start())
		.with_interval(std::time::Duration::from_secs(60))
		.with_max_requests(100),
)

I think it means 100 requests per 60 seconds for each user agents? I'm not sure, since lots of people can have the same user agent.

@wafflecoffee, do you know where are rate limits documented on Modrinth?

I've added an issue so it's easier to find in the future.

@triphora
Copy link

triphora commented Sep 26, 2021

The ratelimit is per minute, so it's actually rather liberal (regulated by Cloudflare). We can add information on this to our docs site soon enough, but it's still very work in progress :)

P.S.: There are also some rudimentary unofficial badge generators for Modrinth already. See https://modrinth-utils.vercel.app

@chris48s
Copy link
Member

Aah I thought the rate limits may be per hour or minute. 200 reqs per second is no issue 馃憤

@chris48s chris48s added the good first issue New contributors, join in! label Sep 27, 2021
@BrenekH
Copy link

BrenekH commented Sep 29, 2021

Is this issue available to pick up? I'd be willing to work on it if no one else is already doing it.

@chris48s
Copy link
Member

chris48s commented Oct 4, 2021

@BrenekH - feel free to pick it up. Our guide for adding new badges is at https://github.com/badges/shields/blob/master/doc/TUTORIAL.md

I think the issue contains all the info needed to work on this. Although when it comes to colours, shields.io uses colours semantically (to convey information) rather than for branding purposes i.e:

  • success
  • critical
  • informational

etc

so a semantic colour scheme should be used by default rather than #5da426

@dominikbrandon
Copy link
Contributor

A few days have passed and no solution was presented so I assumed this issue is abandoned. Therefore I've opened the PR for that - #7132. Please let me know what are your thoughts.

@dominikbrandon
Copy link
Contributor

@NatoBoram this has been merged just now. Feel free to use the new badge!

@calebcartwright
Copy link
Member

Resolved via #7132

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 Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests

6 participants