npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sports-history

v0.0.6

Published

A node.js module that calls up the match results for that date

Downloads

2

Readme

SportsHistory

해당 날짜의 여러 경기 결과를 불러오는 Node.JS Module

npm npm bundle size Travis (.org) GitHub stars HitCount GitHub license

지원하는 종목

  • 국내 야구
    • KBO 리그
  • 국내 농구
    • 프로 농구
    • 여자 프로 농구
  • 국내 축구
    • K리그 1
    • K리그 2
    • 국가대표
    • AFC 챔피언스 리그
  • 해외 야구
    • 메이저리그
    • 일본 프로야구
  • 해외 농구
    • NBA
  • 해외 축구
    • 프리미어리그
    • 라리가
    • 분데스
    • 세리에 A
    • 리그 1
    • 챔피언스 리그
    • 유로파 리그
    • FA컵
    • EFL컵
    • 코파델레이
  • E-Sports
    • LCK
    • LCK CL
    • BSC
    • PWS
    • GSL
    • LCK AS
    • LPL
    • LEC
    • LCS
    • 롤드컵
    • MSI
    • MSC
    • LOL 올스타
    • 케스파컵
    • CK
    • Rift Rivals
    • PCS
    • PGC
    • PKC
    • PKL
    • BWS
    • PMPS
    • VCT 챌린저스
    • VCT
    • WCK
    • 호라이즌 컵
    • OWL
    • OSL
    • 리그오브레전드
    • 스타크래프트 2
    • 오버워치

설치 방법

npm install sports-history

or

yarn add sports-history

사용 방법

SportsHistory

SportsHistory 클래스는 다음과 같은 프로퍼티를 가지고 있습니다.

  • worldSoccer
  • koreaSoccer
  • koreaBasketball
  • worldBasketball
  • koreaBaseball
  • worldBaseball
  • eSports

각 프로퍼티는 운동 종목을 의미하며 해당 운동에 대한 getHistory 함수를 호출하면 됩니다.

getHistory(leagueType, date) → Promise< Information >

leagueType은 경기가 열리는 리그를 선택하는 string 파라미터입니다.

ex)

| 리그 이름 | leagueType | | :----: | :--------: | | 프리미어리그 | epl | | 라리가 | primera |

자세한 내용은 Docs를 참고하세요.

date의 경우 Date 자료형으로 필요한 경기가 열린 날짜를 의미합니다.

따라서 다음과 같은 형태로 호출하면 됩니다.

let data = await new SportsHistory().worldSoccer.getHistory("epl", new Date("2020/02/20"));

Information

Information은 경기 데이터를 담고있는 인터페이스입니다.

getHistory 함수를 통해 데이터를 요청하면 값은 Information[]Promise에 담긴 형태로 전달됩니다.

Information이 가지고 있는 정보는 다음과 같습니다.

| 프로퍼티 | 설명 | | :-----------: | :-----------------------------------------------: | | awayTeamName | Away 팀 이름 | | awayTeamScore | Away 팀 점수 | | homeTeamName | Home팀 이름 | | homeTeamScore | Home 팀 점수 | | gameDate | 경기가 치러진 또는 경기가 치러질 날짜 | | state | 경기의 진행 상태. 종료된 경기면 종료 아니라면 경기 시작 시간 Ex) 16:00 | | title | 경기에 이름. 해당 경기에 특별한 이름이 없는 경우 빈 문자열 | | gameDate | 경기가 치러지는 장소. 데이터가 없는 경우 빈 문자열 |

사용 예제

import SportsHistory from "sports-history";

let sh = new SportsHistory();

sh.worldSoccer
  .getHistory("epl", new Date("2020/1/11"))
  .then((data) => console.log(data));

sh.worldBaseball
  .getHistory("mlb", new Date("2020/05/16"))
  .then((data) => console.log(data));

sh.eSports
  .getHistory("starcraft2", new Date("2020/04/11"))
  .then((data) => console.log(data));

sh.koreaBaseball
  .getHistory("kbo", new Date("2020/04/22"))
  .then((data) => console.log(data));

sh.worldBasketball
  .getHistory("nba", new Date("2020/03/09"))
  .then((data) => console.log(data));
/*
[ { homeTeamName: 'LG',
    awayTeamName: '삼성',
    homeTeamScore: '0',
    awayTeamScore: '0',
    gameDate: '2020-04-22',
    state: '18:30',
    title: '',
    stadium: '잠실' },
  { homeTeamName: 'SK',
    awayTeamName: '두산',
    homeTeamScore: '0',
    awayTeamScore: '0',
    gameDate: '2020-04-22',
    state: '18:30',
    title: '',
    stadium: '문학' },]
*/

더 많은 예제와 사용법은 Docs를 참고하세요.

업데이트 내역

  • 0.0.3
    • Naver 이스포츠 API 바뀐 부분 대응, 새로 생긴 종목 추가
  • 0.0.3
    • NPM Module Description 추가 및 한글 설명 문구 수정
  • 0.0.2
    • 테스트 에러나던 버그 수정
  • 0.0.1
    • 초기 버전 배포

정보

윤종원 – 블로그[email protected]

MIT 라이센스를 준수하며 LICENSE에서 자세한 정보를 확인할 수 있습니다