tsd
tsd copied to clipboard
Proposal - inform about the Github API rate limit
Always a user execute a tsd command without an Github OAuth token, the tsd should display a warn message like this:
Warning: Your Github API rate limit is (30/60 -> 0:31:54). Go to http://a/shortened/url to see how to increase this rate.
NOTE: A http://a/shortened/url will pointing to a page on tsd wiki explaining the warning and how to increase the rate-limit.
Example:
$> tsd query jquery
================================================================
Warning: Your Github API rate limit is (30/60 -> 0:31:54).
Go to http://a/shortened/url to see how to increase this rate
================================================================
- jquery / jquery
@blakeembrey thoughts?
This is a great idea, but the message is confusing. JSPM does a nice job with this. Check out https://github.com/jspm/github/commit/f7839615e3ef7f31e7046479c9c264f8ff1fb2a4
Cool, JSPM seems to do an excellent job. I will take a look and improve this proposal. :+1:
@nycdotnet What about this message:
Warning: GitHub credentials not provided so rate limits will apply. Go to http://a/shortened/url to see how to set this up (remaining 36).
My suggestion:
Warning: GitHub limits unauthenticated API requests (36 remaining). See instructions to authenticate here: http://a/shortened/url .
What's the time - when it will reset? If so, perhaps this:
Warning: GitHub limits unauthenticated API requests (36 of 60 remaining / resets at 0:31:54 UTC). See instructions to authenticate here: http://a/shortened/url .
I am assuming the timestamp is UTC - if not, putting "local" is fine to not have to deal with timezone stuff.
Thanks! It is much better. I have difficulties to write in English.
English is not my native language :)
This is a time to reset, I think is worth to be shown.
Now one more point:
Show this message always a user execute a command without the api token? or show when we have few requests remaining (without the api token)? < 25 remaining requests, for example.
Dude you are fine. You certainly don't want to hear my Portuguese!!
It's nice that people can use tsd without doing this extra step if they only need a few files each time. Since the standard workflow is "query" and then "install", and assuming that only 1 API request is consumed per run, perhaps show if there are 7 or more used API requests and the user is unauthenticated?
Also perhaps show anytime someone is reinstalling from their tsd.json if the count of packages is > 3?
Just some ideas. This is a really nice feature for the users.
Cool! thanks for the suggestions! :smile: :+1:
Sorry for the late response, was busy travelling. I think this looks great :smile: We probably don't need to provide a shortened URL though, or if we do, we can just link to a section on our README. Which reminds me we need to make it a heading about authenticating to make it linkable.
Thanks @blakeembrey. I'll get some time to implement it and test.