Code Monkey home page Code Monkey logo

bookdata's Introduction

benibana_bookdata

下記の外部 API を使用して。書籍情報を取得します。

  • Calil: ISBN をもとに図書館の蔵書情報を検索 TODO:APP_key のリンク
    • 蔵書検索を行うには Calil が提供するAPP_KEY を取得してください
  • OpenBD: ISBN をもとに本のタイトル・書影を取得

Usage

npm i benibana_bookdata
try {
  const res = await beniBook.searchLibraryCollections({
    <<YOUR APP KEY>>,
    '9784837987499', // ISBN
    'Tokyo_Setagaya', // Prefecture
  });
} catch(error) {...}

Methods

searchLibraryCollections({string, number, string, (number)})

指定の書籍の蔵書情報を取得します。ISBN と検索をしたい都市名を記入します。

await beniBook.searchLibraryCollections({
    <<YOUR APP KEY>>,
    '9784837987499', // ISBN
    'Tokyo_Setagaya', // Prefecture
});
/**
 * => [
 *  { libraryID: 1, libraryName: '**', borrowingStatus: '貸出中' }
 *  { libraryID: 2, libraryName: '世田谷', borrowingStatus: '貸出中' }
 *  { libraryID: 3, libraryName: '砧', borrowingStatus: '貸出中' }
 *  { libraryID: 4, libraryName: '代田', borrowingStatus: '貸出可' }
 *  { libraryID: 5, libraryName: '上北沢', borrowingStatus: '貸出中' }
 * ]
 *

options

第四引数にはAPIにGET通信を行う際のポーリングの間隔(ms)を指定します。CalilAPIへはポーリング通信を行うため、一回の通信で情報が取得できない場合は、ここで指定した間隔をおいて連続で通信処理を試みます。これはCalil APIの指定した処理です。

書影の取得

OpenBD API を使用し指定の書籍の書影を取得します。

beniBook.searchBookCoverURL();

ISBN をもとに書籍の書影を取得します。

bookdata's People

Contributors

benibana2001 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.