📚 use-book is a hook that lets you get product info from url or book cover in React.
npm i use-book
git clone github.com/tseijp/use-book
cd use-book
npm i
npm start
- open browser and visit localhost:3000
- Now you can go to our demo, and try its usage.
import React from 'react'
import { useBook } from 'use-book'
export function App() {
const book = useBook('https://amazon.com/xxx/dp/xxx')
return <img {...book.img} />
}
Hook | Description |
---|---|
useBook |
get amazon data from url |
URL
value | https://HOST/images/P/ASIN/ISBN.COUNTRY.SIZE |
---|---|
HOST | images-na.ssl-images-amazon.com or images-jp.amazon.com |
ISBN | International Standard Book Number |
ASIN | Amazon Standard Identification Number |
COUNTRY | Japan:09 |
SIZE
value | mean | w*h size | book size | notes |
---|---|---|---|---|
THUMBZZZ |
samnale | 75×75 | 52×75 | |
TZZZZZZZ |
small | 110×110 | 77×110 | |
MZZZZZZZ |
middle | 160×160 | 112×160 | |
LZZZZZZZ |
large | 500×500 | 349×500 | if h < 500 , return Full size image |