1.0.1 • Published 9 years ago

simple-goodreads v1.0.1

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

simple-goodreads npm

Simple Goodreads API client library for node.js

Configure

  1. Grab your Goodreads developer's key from here
  2. Create a .env file
  3. Add your key to it
    $ KEY=YOUR_DEVELOPER_KEY_GOES_HERE

Install

npm install simple-goodreads

Usage

var SimpleGoodreads = require('simple-goodreads');

var goodreads = new SimpleGoodreads();
goodreads.searchBook('Harry Potter', function (err, book) {
  // book is retrieved
  console.log(book.id); // 3
  console.log(book.title); // Harry Potter and the Sorcerer\'s Stone (Harry Potter, #1)
  console.log(book.author); // J.K. Rowling
  console.log(book.publication_year); // 1997
  console.log(book.rating); // 4.40
});

goodreads.authorInfo('George Orwell', function (err, author) {
  // author is retrieved
  console.log(author.id); // 3706
  console.log(author.name); // George Orwell
  console.log(author.link); // https://www.goodreads.com/author/show/3706.George_Orwell
  console.log(author.gender); // male
  console.log(author.hometown); // Motihari, Bihar
  console.log(author.born_at); // 1903/06/25
  console.log(author.died_at); // 1950/01/21
})

Run tests

$ npm test

License

MIT. Copyright (c) 2015 otsaan.