Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanitsharma/amazon-search-cli
CLI to fetch amazon search results
https://github.com/kanitsharma/amazon-search-cli
Last synced: 20 days ago
JSON representation
CLI to fetch amazon search results
- Host: GitHub
- URL: https://github.com/kanitsharma/amazon-search-cli
- Owner: kanitsharma
- License: mit
- Created: 2023-08-17T21:34:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-23T11:37:52.000Z (about 1 year ago)
- Last Synced: 2024-10-12T22:54:05.668Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Amazon Search CLI
## Some Notes
### Why Puppeteer?
- Amazon is likely blocking non browser traffic, I tried adding User-Agent in the headers but it did not work for me.
- With Puppeteer I can run DOM queries, so I don't have to use a separate html parser.
### Why Commander?
- Commander provides a clean and extensible API to build CLI commands, promoting scalability and maintaining code cleanliness. plus it is very easy to add subcommands, if required in future.
## Basic Usage
Install Dependencies
```bash
npm i
```Compile Typescript
```bash
npm run build
```To get a list of all the commands and options
```bash
node dist/main.js --help
```Npm script is also available if you prefer
```bash
npm run search -- --help
```An example usage would be like
```bash
node dist/main.js --sort rating --desc cookies
```Advanced example
```bash
node dist/main.js --sort rating --desc --prime --limit 5 cookies
```## Might implement in future
- Stream results as soon as they get parsed
- Pagination options
- Option to search in different countries like amazon.in