Skip to content

Commit

Permalink
README.md: add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
danishprakash committed Jul 18, 2018
1 parent a1e1f2b commit 3091fec
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
79 changes: 74 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# goodreadsh
Command line interface for [Goodreads](https://goodreads.com).
<h1 align="center">goodreadsh</h1>
<p align="center">Command line interface for <a href="https://goodreads.com" > Goodreads</a></p>


## 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_key_here>"
```
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
=========
Expand All @@ -33,6 +38,7 @@ Options:
book: book related options
author: author related options
user: user related options
help: show help message
Expand Down Expand Up @@ -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....<snipped>

```
## 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.
1 change: 1 addition & 0 deletions goodreads
Original file line number Diff line number Diff line change
Expand Up @@ -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 <option> help\` for more."
}
Expand Down

0 comments on commit 3091fec

Please sign in to comment.