gistwatcher

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 18 Imported by: 0

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

Documentation

Overview

Package main (gistwatcher.go) : This is a CLI tool for retrieving the number of comments, stars and forks of Gists.

Install

$ go get -u github.com/tanaikech/gistwatcher

More information is https://github.com/tanaikech/gistwatcher

---------------------------------------------------------------

Package main (gistwatcher.go) : These are the methods for gistwatcher.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL