Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eligundry/gatsby-source-goodreads
Gatsby source that allows for displaying of Goodreads shelves
https://github.com/eligundry/gatsby-source-goodreads
gatsby gatsby-plugin gatsbyjs goodreads goodreads-shelves
Last synced: about 2 months ago
JSON representation
Gatsby source that allows for displaying of Goodreads shelves
- Host: GitHub
- URL: https://github.com/eligundry/gatsby-source-goodreads
- Owner: eligundry
- License: mit
- Created: 2021-10-26T04:22:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-18T22:22:51.000Z (almost 3 years ago)
- Last Synced: 2024-10-18T07:52:14.546Z (3 months ago)
- Topics: gatsby, gatsby-plugin, gatsbyjs, goodreads, goodreads-shelves
- Language: TypeScript
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @eligundry/gatsby-source-goodreads
Gatsby source that provides Goodreads shelf information.
## Why Use This?
There are many Gatsby Goodreads sources, why make another? It was fun AND all the sources I'm seeing are using the
Goodreads API which is due to be deprecated soon. This plugin scrapes for the publically accessible HTML available on
their website. Also, no need to fiddle with API keys to pull the data!## Installation
```bash
$ npm install -S @eligundry/gatsby-source-goodreads
```## Usage
In `gatsby-config.js`:
```javascript
module.exports = {
plugins: [
{
resolve: '@eligundry/gatsby-source-goodreads',
options: {
userID: 123,
shelves: ['currently-reading', 'read'],
}
}
]
}
```Then, you can query it like so (this is what I'm using on my site):
```graphql
query UseGoodreadsShelves {
currentlyReading: allGoodreadsBook(
filter: { shelf: { eq: "currently-reading" } }
sort: { fields: started, order: DESC }
limit: 6
) {
books: nodes {
title
author
isbn
url
started
coverImage {
childImageSharp {
gatsbyImageData(width: 175, quality: 90)
}
}
}
}
recentlyFinished: allGoodreadsBook(
filter: { shelf: { eq: "read" } }
sort: { fields: finished, order: DESC }
limit: 6
) {
books: nodes {
finished
title
author
isbn
url
started
coverImage {
childImageSharp {
gatsbyImageData(width: 175, quality: 90)
}
}
}
}
}
```