You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for GitHub pagination and ratelimiting
Create a new GitHubClient class which extends the Client class by modifying
the `request` method and creating four new methods
* Establish a new `paginate` parameter to the constructor
* Modify the `request` method to
* check if there aren't any allowed requests remaining due to ratelimiting
and if so wait the designated amount of time before making the request.
* if the `paginate` parameter is true, look in the payload of the response
page for a [link header](https://tools.ietf.org/html/rfc5988) and if found
extend the fetched data by calling the `get_additional_pages` method
* Create the `no_ratelimit_remaining` method to check if there are no
remaining requests allowed
* Create the `get_additional_pages` method which calls the
`get_next_link_url` method to determine if there are additional pages. If
so, fetch the next page and recursively continue fetching pages until the
last page is fetched
* Create the `get_next_link_url` method which parses the link header and
either returns the next page if there is one or an empty string if not
* Create the `ratelimit_seconds_remaining` method which returns the number
of seconds remaining until the ratelimit is cleared
0 commit comments