Hacker News new | ask | show | jobs
by jeffclark 4120 days ago
This is really impressive. How did you secure the games and scores data?
1 comments

Considering the wide range of possible triggers that don't have any kind of formal api I expect the answer is by scraping the right sites.
At least the NBA and NFL write out RSS feeds of games as they're playing with the scores and plays as they occur, to varying degrees of specificity.

They're kind of a bear to parse, but it's definitely doable without scraping, in some cases.

Hi, do you have a link to these feeds by any chance? Was hoping for something like this for a POC. Thanks!
The NFL game feed is a combination of a couple of feeds. There's

http://www.nfl.com/liveupdate/scorestrip -- which will show you the events and IDs that are currently going active. Right now, in the off-season, it will undoubtedly be blank. You can then take those values and plug them into this one:

http://www.nfl.com/liveupdate/game-center/%s/%s_gtd.json % (year, game_id)

For something to illustrate how they work together, you can check out this repository: https://github.com/BurntSushi/nflgame

I don't remember the one for the NBA, as I've never used it, but I saw an article on reddit a few weeks ago about how to get the data from the NBA using their RSS feed, so I have a good faith belief that it exists.

Thanks for sharing this! The only thing I had found was stuff like SportsXML, etc. but it took me weeks to just get a demo data dump for a single game and the pricing was way too much to bite off.