0.1.0 ā¢ Published 4 years ago
use-amazon v0.1.0
use-amazon
š use-amazon is a hook that lets you get product info from url or book cover in React.
Table of Contents
Install via npm
npm i use-amazon
Quick started
git clone github.com/tseijp/use-amazon
cd use-amazon
npm i
npm start
- open browser and visit localhost:3000
- Now you can go to our demo, and try its usage.
Simple example
import React from 'react'
import { useAmazon } from 'use-amazon'
export function App() {
const book = useAmazon('https://amazon.com/xxx/dp/xxx')
return <img {...book.img} />
}
Available hooks
Hook | Description |
---|---|
useAmazon | get amazon data from url |
Performance pitfalls
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 |
0.1.0
4 years ago