0.0.6 • Published 7 years ago

library-search v0.0.6

Weekly downloads
9
License
ISC
Repository
github
Last release
7 years ago

library-search

Searches www.librarieswest.org.uk

npm install library-search --save

The module exports a function that will:

  1. Search www.librarieswest.org.uk
  2. Scrape the first page of results for exact matches
  3. Follow the link for each exact match
  4. Scrape and combine the available books in each book page
  5. Filter available books by my favourite libraries ;-)
const find = require('library-search')
find('Atonement')
  .then(result => {
    const asJson = JSON.stringify(result, null, 2)
    console.log(asJson)
  })
  .catch(err => {
    console.log('ERROR:', err)
  })

A sample reponse from the above snippet:

[
  {
    "url": "https://www.librarieswest.org.uk/client/en_GB/default/search/detailnonmodal/ent:$002f$002fSD_ILS$002f0$002fSD_ILS:729313/ada?qu=atonement&te=ILS&lm=BOOK&rt=false%7C%7C%7CTITLE%7C%7C%7CTitle",
    "availability": [
      {
        "library": "Bedminster Library",
        "status": "On Shelf"
      }
    ]
  }
]
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago