UNPKG

epl-fixtures

Version:

Fixtures for Premier League clubs

56 lines (51 loc) 1.05 kB
'use strict'; const request = require('./request') class Fixtures { /** * Get fixtures for all clubs * @param callback */ all(callback) { request('ALL', (err, matches) => { callback(err, matches); }); } /** * Get fixtures for specific club * @param club * @param callback */ club(club, callback) { const clubs = { 'arsenal': 3, 'aston villa': 7, 'bournemouth': 91, 'chelsea': 8, 'crystal palace': 31, 'everton': 11, 'leicester': 13, 'liverpool': 14, 'man city': 43, 'man utd': 1, 'newcastle': 4, 'norwich': 45, 'southampton': 20, 'stoke': 110, 'sunderland': 56, 'swansea': 80, 'spurs': 6, 'tottenham': 6, 'watford': 57, 'west brom': 35, 'west ham': 21 }; request(clubs[club], (err, matches) => { callback(err, matches); }); } } module.exports = Fixtures; // //new Fixtures().club('liverpool', function (err, matches) { // console.log(err, matches); //})