Code Monkey home page Code Monkey logo

hubot-baseball's Introduction

hubot-baseball NPM version

A Hubot plugin for pulling in today's MLB games (and scores).

Usage

hubot baseball - Pulls today's games
hubot baseball <team abbreviation> - Pulls today's game for a given team (ex. SF, NYY).

hubot baseball

Installation

  1. npm install hubot-baseball --save
  2. Add "hubot-baseball" to your external-scripts.json file.
  3. Reboot Hubot.

Contributors

hubot-baseball's People

Contributors

erunion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hubot-baseball's Issues

fails if there's only one game today

It's "opening night", only one game today, (Cards/Cubs):

rybot baseball

(from logs:)
[Sun Apr 05 2015 17:23:57 GMT+0000 (UTC)] ERROR TypeError: undefined is not a function
at /home/ryan/node_modules/hubot-baseball/src/baseball.coffee:29:19, :23:15

Seems sorting one item fails there?

data input file is: http://gd2.mlb.com/components/game/mlb/year_2015/month_04/day_05/master_scoreboard.json

in that json, data.games.game is a singular object, NOT an array.

in json from a couple days prior:
http://gd2.mlb.com/components/game/mlb/year_2015/month_04/day_03/master_scoreboard.json

... data.games.game is an array, with a length.

Unclear whether they've change the json format for this season, or if it's an edge-case for days with one game. I guess we'll know tomorrow.

note, this phenomenon occurred last time there was one game on a day, in the playoffs. compare October:
several 1st round playoff games:
http://gd2.mlb.com/components/game/mlb/year_2014/month_10/day_05/master_scoreboard.json

game 7 of world series, single game:
http://gd2.mlb.com/components/game/mlb/year_2014/month_10/day_29/master_scoreboard.json

(disclosure: I used to work at MLBAM, and know more about the backend stuff that's generating these files than perhaps I should. :) )

Better team detection

Right now team detection requires team abbreviations, which aren't always that obvious (SFG and SF are both allowable for the Giants), so it'd be cool to add in a hardcoded list of team names so you could do:

hubot baseball giants

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.