tiny-rebel-web-scraper
Web scraper for getting beer information from the Tiny Rebel beer board
Last updated 3 years ago by tomseldon .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tiny-rebel-web-scraper 
SYNC missed versions from official npm registry.

Tiny Rebel web scraper

A small library for querying available drinks at Tiny Rebel bars

Build Status Build status

Basic usage

npm install tiny-rebel-web-scraper

const tinyRebelWebScraper = require('tiny-rebel-web-scraper');

// Bar location should be specified as "cardiff" or "newport"
tinyRebelWebScraper.getAllDrinks('cardiff')
    .then((drinks) => {
        for (const drink of drinks) {
            console.log(`${drink.name}: ${drink.formattedPrice}`);
        }
    })
    .catch((error) => {
        // Failed to load what drinks are available
        console.error(error);
        throw error;
    });

API

getAllDrinks

Get all drinks at the specified bar.

Method signature

getAllDrinks (barLocation: string): Promise<Drink[]>

getAllKegDrinks

Get all keg drinks at the specified bar.

Method signature

getAllKegDrinks (barLocation: string): Promise<Drink[]>

getAllCaskDrinks

Get all cask drinks at the specified bar.

Method signature

getAllCaskDrinks (barLocation: string): Promise<Drink[]>

Return values

The API will return an array of Drink objects, i.e. POJOs with the following properties.

// Drink
{
    abv: 4.2,
    available: true,
    brewery: 'Tiny Rebel Brewing Co. (Newport, South Wales)',
    cask: true,
    currency: 'GBP',
    formattedAbv: '4.2%',
    formattedPrice: '£3.30',
    keg: false,
    name: 'You Snows It',
    price: 3.3,
    quantity: 'pint',
    style: 'Pale Ale',
    vegan: false
}

Note: Pricing information for drinks will not always be available, in which case the price will be reported as null and the formattedPrice will be reported as 'Unknown'.

Current Tags

  • 1.0.5                                ...           latest (3 years ago)

7 Versions

  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (11)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |