gistwatcher
Overview
This is a CLI tool for retrieving the number of comments, stars and forks of Gists.
Demo
In this demonstration, a Gist is retrieved by an URL. You can see that the number of comments, stars and forks can be retrieved.
Install
You can install this using go get
as follows.
$ go get -u github.com/tanaikech/gistwatcher
Usage
Requirement
gistwatcher uses the account name and password of GitHub. This is used for using GitHub API. The values are retrieved by the API with the account name and password.
Also you can use the access token instead of the account name and password. In that case, please retrieve the access token by yourself.
Methods
For all methods, JSON object is returned.
$ gistwatcher -s -u https://gist.github.com/#####/#####
- You can retrieve values using the user name. When user name is used, all Gists of the user are retrieved.
$ gistwatcher -s -user #####
- You can retrieve values using the user name. When user name is used, all Gists of the user are retrieved.
$ gistwatcher -s -f filename.txt
The sample file is as follows.
https://gist.github.com/#####/#####
https://gist.github.com/#####/#####
https://gist.github.com/#####/#####
Options
Options |
Description |
--name, --n |
Login name of GitHub. |
--password, --p |
Login password of GitHub. |
--accesstoken, --a |
Access token of GitHub. If you have this, please use this instead of 'name' and 'password'. |
--getstars, --s |
If you want to also retrieve the number of stars and forks, please use this. |
--username, --user |
User name of Gist you want to get. If you want to retrieve a specific user's Gists, please use this. |
--url, --u |
URL of Gists you want to retrieve. You can also use Gist's ID instead of URL. |
--file, --f |
Filename including URLs of Gists you want to retrieve. |
--help |
Show help. |
- You can also use the environment variables for the account name and password, and the access token.
- Environment variables for account name and password are
GISTWATCHER_NAME
, GISTWATCHER_PASS
, respectively.
- Environment variables for access token is
GISTWATCHER_ACCESSTOKEN
.
Note
- In the current stage, in order to retrieve the number of stars and forks, it is required to directly scrape Gists. So I decided to use the bool flag when the number of stars and forks are retrieved.
Licence
MIT
Author
Tanaike
If you have any questions and commissions for me, feel free to tell me.
Update History
-
v1.0.0 (May 16, 2019)
- Initial release.
-
v1.0.2 (January 3, 2020)
- It seems that the specification of
github.com/urfave/cli
was changed by the update of https://github.com/urfave/cli. By this, when go get -u github.com/tanaikech/gistwatcher
is run, an error occurred. So this error was removed.
TOP