Ei kuvausta

Lucas Stadler d767e2d6e8 Add Makefiles for unpaginate and stars 10 vuotta sitten
..
.gitignore fb1c63a477 Ignore all JSON files, not just the stars 10 vuotta sitten
Makefile d767e2d6e8 Add Makefiles for unpaginate and stars 10 vuotta sitten
README.md e977e4e9ca Add an example for reading repos from a file 10 vuotta sitten
stars.go 7cc4dec177 Make the usage message prettier 10 vuotta sitten

README.md

stars

stars fetches your GitHub stars and updates them as necessary. It is not necessarily limited to just GitHub, as it will accept any git url that's publicely accessible.

Usage

stars accepts the input from various GitHub API endpoints that return lists of repositories.

# Fetch starred repositories
$ curl https://api.github.com/users/heyLu/starred | ./stars
...

# Fetch public repos
$ curl https://api.github.com/users/heyLu/repos | ./stars
...

# Fetch all repos (public, private, org member)
$ token=<personal access token>
$ curl -u heyLu:$token https://api.github.com/user/repos | ./stars

# Fetch repos from a file
$ ./stars < repos.json
...

However, note that GitHub's API uses pagination, so ensure you set the per_page query parameter appropriately, or use a tool such as unpaginate which collects the results from the pages into one JSON document:

$ unpaginate https://api.github.com/users/heyLu/starred | ./stars
...

Input format

stars reads an array of JSON objects from stdin. It must have full_name and git_url fields, should have a pushed_at field and also an optional description field.

For example:

[
  {
    "full_name": "ProseMirror/prosemirror",
    "description": "The ProseMirror WYSIWYM editor",
    "pushed_at": "2015-08-06T21:37:16Z",
    "git_url": "git://github.com/ProseMirror/prosemirror.git",
  },
  ...
]