/decor

Command for displaying various information on terminal.

Primary LanguageCrystalApache License 2.0Apache-2.0

decor

Command for displaying various information on terminal.

Usage

% crystal build runner.cr
% ./runner get --immediately --config ./config.json
% ./runner puts

Gmail requires authentication by code. To do the authentication, execute with the with-auth option.

% ./runner get --immediately --with-auth --config ./config.json

Config.json

  • service
    • Service name. "gmail" or "twitter".
  • key
    • Unique key.
  • expires_in
    • The expiration date of the data. Not used when immediately option is specified.
  • path
    • Absolute path of the directory containing client_secret file.

Example

{
    "order": [
        {
            "service": "gmail",
            "key": "gmail",
            "expires_in": 600,
            "path": "/your/env/dir/gmail/"
        },
        {
            "service": "twitter",
            "key": "twitter",
            "expires_in": 600,
            "path": "/your/env/dir/twitter/"
        },
        {
            "service": "twitter",
            "key": "<unique key>",
            "arg": "u:<Twitter screen name>",
            "expires_in": 600,
            "path": "/your/env/dir/twitter/"
        },
        {
            "service": "twitter",
            "key": "<unique key>",
            "arg": "s:<Search word of Twitter>",
            "expires_in": 600,
            "path": "/your/env/dir/twitter/"
        }
    ]
}

client secret

The client_secret file is required for operation.

Gmail

Please download the client_secret file from the authentication information of Google Cloud Platform console.

Twitter

{
    "consumer_key": "your consumer key",
    "consumer_secret": "your consumer secret",
    "token": "your token",
    "token_secret": "your token secret"
}