Categorygithub.com/tanaikech/gistwatcher
modulepackage
1.0.2
Repository: https://github.com/tanaikech/gistwatcher.git
Documentation: pkg.go.dev

# README

gistwatcher

Build Status MIT License

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.

1. Retrieve the number of comments, stars and forks of Gists from URLs and Gists IDs

$ 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.

2. Retrieve the number of comments, stars and forks of all Gists of an user

$ gistwatcher -s -user #####
  • You can retrieve values using the user name. When user name is used, all Gists of the user are retrieved.

3. Retrieve the number of comments, stars and forks of all Gists from a file including Gists URLs

$ gistwatcher -s -f filename.txt

The sample file is as follows.

https://gist.github.com/#####/#####
https://gist.github.com/#####/#####
https://gist.github.com/#####/#####

Options

OptionsDescription
--name, --nLogin name of GitHub.
--password, --pLogin password of GitHub.
--accesstoken, --aAccess token of GitHub. If you have this, please use this instead of 'name' and 'password'.
--getstars, --sIf you want to also retrieve the number of stars and forks, please use this.
--username, --userUser name of Gist you want to get. If you want to retrieve a specific user's Gists, please use this.
--url, --uURL of Gists you want to retrieve. You can also use Gist's ID instead of URL.
--file, --fFilename including URLs of Gists you want to retrieve.
--helpShow help.
  1. 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)

    1. Initial release.

  • v1.0.2 (January 3, 2020)

    1. 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

# Structs

No description provided by the author
No description provided by the author