From 3091fec3c5653eb7448114c6153e024839fcfb0d Mon Sep 17 00:00:00 2001 From: prakashdanish Date: Wed, 18 Jul 2018 10:31:42 +0530 Subject: [PATCH] README.md: add examples --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++---- goodreads | 1 + 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c896984..fe8f563 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,32 @@ -# goodreadsh -Command line interface for [Goodreads](https://goodreads.com). +

goodreadsh

+

Command line interface for Goodreads

+ ## Installation +#### Manual installation 1. Clone this repository. 2. Grant executable permission to `goodreads` 3. Add directory path to `PATH` -```sh +```console $ git clone https://github.com/prakashdanish/goodreadsh && cd goodreadsh $ export PATH="$PATH:/path/to/dir" $ chmod +x goodreads ``` #### Developer key -`goodreadsh` requires a goodreads developer key in order to use it's API. Generating your developer key is easy. +`goodreadsh` requires your developer key in order to use the goodreads API, obtaining one is fairly trivial. + 1. Access your developer key [here](https://www.goodreads.com/api/keys). 2. Copy your developer key over to `goodreadsh`'s config file. `~/.goodreads.conf` ```sh DEVELOPER_KEY="" ``` +Your config file should already be present in your home dir `~/.goodreads.conf` and if it's not, then run the command once without any options or create the file manually. ## Usage -```sh + +```text ========= goodreads ========= @@ -33,6 +38,7 @@ Options: book: book related options author: author related options user: user related options + help: show help message @@ -80,3 +86,66 @@ Options: -g --id: show goodreads id -s --shelf [label]: show books from given shelf ``` + +## Examples + +```sh +$ goodreads book --rating 1984 +4.16 + +$ goodreads book --rating-dist "animal farm" +★ ★ ★ ★ ★ : 736953 +★ ★ ★ ★ ☆ : 768149 +★ ★ ★ ☆ ☆ : 463984 +★ ★ ☆ ☆ ☆ : 143183 +★ ☆ ☆ ☆ ☆ : 71234 + +Total : 2183503 + +$ goodreads author --books orwell +1984 +Animal Farm +Animal Farm / 1984 +Down and Out in Paris and London +Homage to Catalonia +Burmese Days +Keep the Aspidistra Flying +The Road to Wigan Pier +Coming Up for Air +Shooting an Elephant + +$ goodreads user --shelf currently-reading prakashdanish +Learn Vimscript the Hard Way +The Linux Command Line +Norwegian Wood +Practical Vim: Edit Text at the Speed of Thought + +$ goodreads book --desc "my experiments with truth" +Mohandas K. Gandhi is one of the most inspiring figures of our time. In his classic.... + +``` +## Contribution +If you would like to contribute, submit an issue and/or send a PR. + +## License +MIT License + +Copyright (c) 2018 [Danish Prakash](https://github.com/prakashdanish) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/goodreads b/goodreads index 012d194..d500297 100755 --- a/goodreads +++ b/goodreads @@ -38,6 +38,7 @@ function show_help () { echo " book: book related options" echo " author: author related options" echo " user: user related options" + echo " help: show help message" echo echo "Enter \`goodreads