https://github.com/dance2die/google-book-shell
Search Google Books in a Shell.
https://github.com/dance2die/google-book-shell
amazon cli node shell
Last synced: about 2 months ago
JSON representation
Search Google Books in a Shell.
- Host: GitHub
- URL: https://github.com/dance2die/google-book-shell
- Owner: dance2die
- License: mit
- Created: 2017-11-23T03:27:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T03:23:42.000Z (over 8 years ago)
- Last Synced: 2025-08-03T22:46:32.270Z (11 months ago)
- Topics: amazon, cli, node, shell
- Language: JavaScript
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Book Shell
Search [Google Books](https://books.google.com/) from command line window.
## Video of "How to Install & Use Google-Book-Shell"
[](http://www.youtube.com/watch?v=XK4NgwJqw0s "Google Book Shell (NodeJS CLI) Demo
")
## How to Install
> npm install -g google-book-shell
If you have already installed it before (Thank you π), update it as shown below.
> npm update -g google-book-shell
Link to [Google-Book-Shell](https://www.npmjs.com/package/google-book-shell) NPM page.
_____
## How to Run πβ
Type `gbs`
```bash
dance2die@LELOUCH c:\misc\sources
> gbs
google book search$
```
_____
## Usage
Type `help` for the list of commands
```bash
google book search$ help
Commands:
help [command...] Provides help for a given command.
exit Exits application.
search search for a book in Google Books
open open # in searched book list
view view detailed description of the book
print print searched books
```
_____
## Commands
### **search**
- USAGE: `search ` (book name is required).
- ALIAS: `s`
- DESCRIPTION: Searches for the book on Google Books.
- If the name has a space, use a double/single quote around the name.
- EXAMPLE
```bash
google book search$ search "Grokking Algorithms"
01: Grokking Algorithms
02: Grokking Deep Learning
03: Algorithms For Dummies
04: Algorithms Unlocked
05: Data Structures and Algorithms in Python
06: Essential Algorithms
07: The Algorithm Design Manual
08: The CS Detective
09: Algorithmic Puzzles
10: Python Algorithms
```
### **open**
- USAGE: `open [options] ` (number is required).
- ALIAS: `o`
- DESCRIPTION: Opens the searched book by the search result order in a *web browser*.
- *NOTE*: Works only after **search** is run.
- OPTIONS:
```bash
Options:
--help output usage information
-a, --amazon open Amazon link
-s, --strip-amazon-affiliate strip affiliate query parameter
```
- `--amazon` (or `-a` for short): Opens Amazon Web Link with affiliate info
- Amazon's Product API requires a developer to sign up as an affiliate so this was unavoidable.
- So I added the following option (`-s`) to strip out affiliate info if you choose to do so
- This flag calls an Azure Function, which needs to wake up after some inactivity (Takes about 10~30 seconds). It will work faster after the first call.
[](https://youtu.be/htMZAkHSM94)
- `--strip-amazon-affiliate` (or `-s` for short): Strip out affiliate info (Please support me by not using this flag πΌ)
- e.g.)
- `open 1`
- `open -a 1` (or `open --amazon 1`)
- `open -a -s 1` (or `open --amazon --strip-amazon-affiliate 1`)
- YouTube walk-through
[](https://www.youtube.com/watch?v=_6tfVYkrJQU")
### **view**
- USAGE: `view [number]` (number is optional).
- ALIAS: `v`
- DESCRIPTION: Displays the description of the searched book in *console* by search result order.
- When `[number]` argument is missing, it will let user choose a book to view detail for
- *NOTE*: Works only after **search** is run.
- EXAMPLE **with** `[number]` argument.
![Example with `[number]` argument.](https://i.imgur.com/J5THPsJ.gif)
- EXAMPLE **withOUT** `[number]` argument.
![Example withOUT `[number]` argument.](https://i.imgur.com/leUgfor.gif)
### **print**
- USAGE: `print`
- ALIAS: `p`
- DESCRIPTION: Reprints searched book result
- *Note*: Displays nothing when no search was performed previously.
- EXAMPLE
```bash
google book search$ print
01: Grokking Algorithms
02: Grokking Deep Learning
03: Algorithms For Dummies
04: Algorithms Unlocked
05: Data Structures and Algorithms in Python
06: Essential Algorithms
07: The Algorithm Design Manual
08: The CS Detective
09: Algorithmic Puzzles
10: Python Algorithms
```
## Demo using Aliases only
You can search, view details, and open browser much faster with aliases.
[](https://youtu.be/R1BYlWvktGs)
_____
## How toβ πβ from the Source
1. Clone the source:
`git clone https://github.com/dance2die/google-book-shell.git`
2. Install NPM packages/dependencies
`npm install` or `yarn`
3. Run it using `npm` or `yarn`
- `yarn start`
--or--
- `npm run start`
_____
## TODO
- Separate each command into different files.
- Use a plugin archiecture to dynamically load commands.
- ? Compare prices from Google Books/Amazon/Barnes & Noble?