njt / good-reads
PHP wrapper to communicate with Goodreads API.
Requires
- php: ~5.5|~7.0
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2024-10-30 20:51:12 UTC
README
PHP wrapper to communicate with Goodreads API.
Requirements
- PHP >= 5.5.3
Installation
composer require njt/good-reads
Getting Started
Before using Goodreads API you must create a new application. Visit signup form for details.
Setup client:
$gr = new GoodReads('api_key');
Examples
Lookup books
You can lookup a book by ISBN, ID or Title:
$gr->bookByISBN("ISBN"); $gr->book("id");
Search for books:
$gr->searchBook("Search any think"); $gr->searchBookByName("Book Name"); $gr->searchBookByAuthorName('Author Name');
Authors
Look up an author by their Goodreads Author ID:
$author = $gr->authorByID("id");
Look up an author books by their Goodreads Author ID:
$books = $gr->authorBooks("id");
Get Author ID by Author Name:
$id = $gr->authorIDByName("Author Name");
Look up an author by name:
$author = $gr->authorByName("Author Name");
Author series:
$series = $gr->seriesByAuthor("id");
Reviews
Get review details:
$review = $gr->review('id');
Get User review details by Book:
$review = $gr->userReviewByBook('userID', 'bookID');
User
Get the user by id:
$user = $gr->userInfoByID('id');
Get the user by username:
$user = $gr->userInfoByUsername('username');
Groups
Get group details:
$group = $gr->group('id', 'sort');
The sort
parameter is optional, and defaults to title
.
One of comments_count
, title
, updated_at
, views
Find group by Name:
$groups = $gr->findGroup('group Name');
List the groups a given user is a member of:
$groups = $gr->groupsOfUser('userID', 'sort');
The sort
parameter is optional, and defaults to members
.
One of my_activity
, members
, last_activity
, title
List the group Members a given group id:
$members = $gr->groupMembers('id');
Contributions
You're welcome to submit patches and new features.
- Create a new branch for your feature of bugfix
- Add tests so it does not break any existing code
- Open a new pull request
- Check official API documentation
License
The MIT License (MIT)
Nijat Asadov, nijatasadov@gmail.com