1.1.1 • Published 3 years ago

@rpidanny/nietzsche.js v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

nietzsche.js

gh-actions codecov

A JavaScript package to download quotes from Goodreads.

Install

$ npm install --save @rpidanny/nietzsche.js

Usage

Basic example

import { getAllQuotesByTag } from '@rpidanny/nietzsche.js'

const quoteResponse = await getAllQuotesByTag('psychology')
console.log(quoteResponse)

API Documentation

getQuotesByTag(options?)

Type: object

keydefaulttypedescription
tagNonestringThe name of the tag to search. e.g. psychology, economics
page1numberThe page number to get the quotes from.

Response Type: GetQuotesResponse

getAllQuotesByTag(options?)

Type: object

keydefaulttypedescription
tagNonestringThe name of the tag to search. e.g. psychology, economics
concurrency10numberThe number of parallel requests to goodreads
maxPages100numberThe maximum number of pages to get quotes from

Response Type: Array<Quotes>

getQuotesByPath(options?)

Type: object

keydefaulttypedescription
pathNonestringThe relative url path to extract quotes from. e.g. quotes, quotes/tag/economics
page1numberThe page number to get the quotes from.

Response Type: GetQuotesResponse

getAllQuotesByPath(options?)

Type: object

keydefaulttypedescription
pathNonestringThe relative url path to extract quotes from. e.g. quotes, quotes/tag/economics
concurrency10numberThe number of parallel requests to goodreads
maxPages100numberThe maximum number of pages to get quotes from

Response Type: Array<Quotes>

Types

Quote

{
  text: string
  author: string
  likes: number
  tags: Array<string>
}

GetQuotesResponse

{
  quotes: Array<Quote>
  pageNumber: number
  totalPages: number
  count: number
}