Giter Club home page Giter Club logo

bookcovers's Introduction

bookcovers

A federated search API for finding image thumbnails for book covers.

Performs a combined search of Amazon, Google Books and Open Library to find thumbnails corresponding to isbn numbers.

bookcovers is node library and cli tool. It currently does not work in browser environments.

Install

npm i -g bookcovers

Example Usage

As a library within a node application:

const bookcovers = require("bookcovers");

bookcovers
  .withIsbn("9781570273148")
  .then(results => ...);

As a cli:

bookcovers <isbn>;
# logs out book cover data in the form "<source> <size> <url>"

Specify which service to use:

bookcovers <isbn> --type amazon;
# only searches Amazon

API

bookcovers.withIsbn(isbn: string, options?: { ... });

Returns a promise that resolves to an object containing urls from each of the sources.

{
  amazon: {
    '1x': 'https://m.media-amazon.com/images/I/51z2HY7kn4L._AC_UY218_ML3_.jpg',
    '1.5x': 'https://m.media-amazon.com/images/I/51z2HY7kn4L._AC_UY327_FMwebp_QL65_.jpg',
    '2x': 'https://m.media-amazon.com/images/I/51z2HY7kn4L._AC_UY436_FMwebp_QL65_.jpg',
    '2.2935x':'https://m.media-amazon.com/images/I/51z2HY7kn4L._AC_UY500_FMwebp_QL65_.jpg'
  },
  google: {
    smallThumbnail: 'http://books.google.com/books/content?id=wDVV6y-8YHEC&printsec=frontcover&img=1&zoom=5&source=gbs_api',
    thumbnail: 'http://books.google.com/books/content?id=wDVV6y-8YHEC&printsec=frontcover&img=1&zoom=1&source=gbs_api'
  },
  openLibrary: {
    small: 'http://ia801606.us.archive.org/zipview.php?zip=/26/items/olcovers36/olcovers36-S.zip&file=369091-S.jpg',
    medium: 'http://ia801606.us.archive.org/zipview.php?zip=/26/items/olcovers36/olcovers36-M.zip&file=369091-M.jpg',
    large: 'http://ia801606.us.archive.org/zipview.php?zip=/26/items/olcovers36/olcovers36-L.zip&file=369091-L.jpg'
  }
}

Options

  • type - Specify a service: 'amazon' | 'google' | 'openLibrary'. Default: null (all).
  • amazon - Specify additional options for puppeteer amazon scraper
  • google - Specify additional options for request google scraper
  • openLibrary - Specify additional options for request open library scraper

bookcovers's People

Contributors

abrakadobr avatar dependabot[bot] avatar e-e-e avatar kyeondiscord avatar raineorshine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bookcovers's Issues

Smoke Test Failing

It looks like the smoke test is failing for amazing. The test still succeeds locally, so this is probably an issue with Amazon blocking Github actions IP. Not sure how to fix this if that is the case. But first thing first is to confirm.

Puppeteer Error in React App

Attempted to use this library in a React app but I get this error in the browser:

./node_modules/puppeteer/lib/WebSocketTransport.js
Module not found: Can't resolve 'ws' in '.../node_modules/puppeteer/lib'

Repo name

Recommend renaming repository to "bookcovers" to match npm package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.