Нет описания

Lucas Stadler bd3c5dc805 Add a README лет назад: 10
..
.gitignore 640a4f7191 Unpaginate all the (json) resources лет назад: 10
README.md bd3c5dc805 Add a README лет назад: 10
unpaginate.go 969309f365 Support for basic auth with token or password лет назад: 10

README.md

unpaginate

unpaginate unpaginates JSON resources.

The requested resource is assumed to return an array of JSON objects. unpaginate prints a new array containing the JSON objects from all pages on stdout.

Pagination is assumed to be in the format that the GitHub v3 API uses:

HTTP/1.1 200 OK
...
Link: <https://api.github.com/user/527119/repos?per_page=42&page=2>; rel="next", <https://api.github.com/user/527119/repos?per_page=42&page=2>; rel="last"

Usage

$ ./unpaginate https://api.github.com/users/heyLu/repos
...

$ ./unpaginate -user heyLu:$token https://api.github.com/user/repos
...

Note that the resources must return arrays of JSON objects. Any other kind of input will break unpaginate, sometimes in unexpected ways.

unpaginate was written to be used with stars, but is hopefully also useful in other contexts.