PeridexisErrant / starter-pack

Automatically build a Starter Pack release from nothing
Other
123 stars 17 forks source link

Increase GitHub API ratelimit by supporting OAuth or conditional requests #2

Closed PeridexisErrant closed 8 years ago

PeridexisErrant commented 8 years ago

https://developer.github.com/v3/#rate-limiting

Currently starter-pack only creates a complete cache, and deletes the cache when it's older than one hour. Since increasing the GH API ratelimit from 60 to 5K requests/hour is useful when testing, starter-pack can currently use a _CRED file with user\npass for HTTP basic auth, but this breaks for users with two-factor auth.

Supporting OAuth or conditional requests would be nice, but both look complicated enough to be log priority. Reasonable solutions gratefully accepted!

lethosor commented 8 years ago

What are you using the Github API for, anyway? You could always use an existing API client if you need it (pygithub?).

PeridexisErrant commented 8 years ago

metadata_api.py grabs the latest release or tag, and returns the associated version (or tag) string, timestamp, and selected download url.

Actually navigating the API is dead easy for this, and it looks like pygithub would be overkill - all I really need to do is cache stuff more intelligently, and more advanced caching should be interesting and educational enough to do for its own sake.

PeridexisErrant commented 8 years ago

984ee228 implements timestamp-conditional requests to the GitHub API.

Since this doesn't require a GitHub account at all, I'm counting it as a better solution than Oauth and closing the issue. Further upgrades remain likely.