baseballhackday

Open full view…

Uecker - The Baseball Campfire Bot!

dthyresson
Mon, 10 Feb 2014 21:28:46 GMT

Last year I messed around writing an internal company Campfire bot called "Cosell" that would respond to chats with recent sports stats. > DT: cosell me red sox > cosell: The Red Sox won yesterday 6-1 over the Cardinals. > DT: cosell me > cosell: Down goes Fraser! > DT: cosell me Ortiz > cosell: David Ortiz had 4 walks vs the Cardinals. Cosell would cover all sports. But ... The project didn't access public data and wasn't easily extracted for other people to use. So, Uecker is going to use standards like Hubot - http://hubot.github.com/ and Node.js and Coffee/Javascript. It'll be deployed on Heroku - http://andreicek.eu/post/hubot-on-campfire-with-heroku/. Hopefully, the scripts can be added to the Hubot library If you don't know what Campfire or Hubot is, it "dramatically improve and reduce employee efficiency" by letting them get baseball stats and results at their fingertips. Since there is a Node.js package for fetching MLB Gameday data - https://npmjs.org/package/gameday-fetch - it will use (and likely extend) that. It'll have to parse XML and return some interesting result in text - or something (like a chart or a sparkline) that can be represented as text. Each person/teammate can work on a set of Euker commands, such as: > euker me <team> last night > euker me <player> last night > euker me <team> schedule > euker me <team> today > euker me <player> stats > euker me yesterday games > euker me boxscore <gameid> those are just the boring ones maybe > euker me <game> fastest pitch > euker me <game> attendance We;d have to go through the GameDay data and see what would be useful to grab.

dthyresson
Mon, 10 Feb 2014 21:38:48 GMT

What, I can't edit this for all my eucker/euker typos? I of course forgot the default Eucker response: > DT: eucker me > eucker: Just a bit outside!

dthyresson
Mon, 10 Feb 2014 21:40:22 GMT

and yes, there will be a Mr. Belvedere eater egg

dthyresson
Tue, 11 Feb 2014 19:41:29 GMT

Have changed my mind: going to use and build upon the features in https://github.com/alawson421/espn-node the ESPN node helpers and use ESPN's api. May now call this Cosell again as can support other sports, too. I'll provide: * Hubot setup than can be cloned * Hubot hosted and running on Heroku * A campfire room where Eucker will live and can interact Will need: * People w/ node/coffescript skills to work on ESPN node features * Scripts to respond to commands * Ideas of fun commands to build * Designers to make an awesome GitHub pages site for the library (jekyll etc)

daigofuji
Fri, 21 Feb 2014 04:47:17 GMT

David, you should look into SportsData's API. They will be giving us an access on the hack day and if you win "Best use of their API" award, you'll get a free access to their 2014 "Real-Time" MLB API. http://developer.sportsdatallc.com/docs/MLB_API

dthyresson
Mon, 24 Feb 2014 14:37:47 GMT

Daigo - the award is tempting, but I realized that I want Eucker to be be available in the Hubot public community scripts w/out API subscriptions. And as I realized, even ESPN's didn't help with that -- all their score data was premium content. So, I've instead elected to pull data from MLB Gameday's http://gd2.mlb.com/components/game/mlb/ area Did a little test run yesterday to prove that the concept works: [Flint](//res.cloudinary.com/moot/image/upload/t_d3-gallery-s1/v1393252666/:baseballhackday:2eem:flint.png.jpg)