arthurnn / cheatly

A cheat-sheet cli for a cheat repository
MIT License
47 stars 16 forks source link

403 - API rate limit exceeded #42

Open arthurnn opened 9 years ago

arthurnn commented 9 years ago

Every command, we call GitHub api to fetch files and so on. However this can cause issues like API rate limit. Ways to solve this:

misaka commented 9 years ago

Hi there. Just came upon this project from the 24PR site, I like the project.

I also like the idea of using a cache, that would solve offline access and if it checked it first, we'd also be more responsive for the user. Also, consider that since the gem has been installed with the sheets locally, so we can also use those. So we would have three locations where the sheets could be found:

  1. Where the gem is installed (default sheet used when there's no update on GitHub and also for offline access).
  2. In the local cache directory (in ~/.cheatly/sheets for example, used as a copy of the updated sheet on GitHub).
  3. On GitHub (the source of all updated sheets).

And we'd need a way to track when was the last time we checked GitHub for an update, maybe through a file we touch on the filesystem (like ~/.cheatly/checked/#{sheet_name}). I was thinking I would do some gherkin-style specs to describe how the process would look, would adding cucumber to this project be too much?