Home

Awesome

livesoccertv-parser

© All rights reserved to Live soccer TV

<p align="center"> <a href="https://github.com/pablopunk/miny"><img src="https://img.shields.io/badge/made_with-miny-1eced8.svg" /></a> <a href="https://www.npmjs.com/package/livesoccertv-parser"><img src="https://img.shields.io/npm/dt/livesoccertv-parser.svg" /></a> </p> <p align="center"> <i>Parse games info from livesoccertv</i> </p>

Install

npm install livesoccertv-parser

Usage

The parser works with promises:

const {getMatches} = require('livesoccertv-parser')
console.log(await getMatches('spain', 'real-madrid')) //=> [{...}, {...}, ...]

Match object:

Match {
  live: false,
  played: true,
  competition: 'Supercopa de España',
  date: 'August 13',
  time: '4:00 PM',
  game: 'Barcelona vs Real Madrid',
  tvs:
    [
      'TeleCinco',
      'TV3',
      'Radio Barca'
    ]
}

API

By default, the timezone is America/New_York. You can set your own with:

getMatches('spain', 'real-madrid', { timezone: 'Europe/Madrid' })
getMatches('england', 'arsenal', { timezone: 'Europe/London' })

You can search for teams like so:

const {searchTeams} = require("livesoccertv-parser")
searchTeams("madrid")
// [
//   ["spain", "real-madrid"],
//   ["spain", "atletico-madrid"],
// ]

Contribute

Feel free to open an issue or a PR.

License

MIT

Related

More at pablopunk.com

Author

me
© 2018 Pablo Varela