simple-goodreads
v1.0.1
Published
Simple Goodreads API client library for node.js
Downloads
4
Readme
simple-goodreads
Simple Goodreads API client library for node.js
Configure
- Grab your Goodreads developer's key from here
- Create a
.env
file - 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.