Closed cmosguy closed 10 years ago
From nflgame/nflgame/update_sched.py:
def schedule_url(year, stype, week):
"""
Returns the NFL.com XML schedule URL. `year` should be an
integer, `stype` should be one of the strings `PRE`, `REG` or
`POST`, and `gsis_week` should be a value in the range
`[0, 17]`.
"""
xmlurl = 'http://www.nfl.com/ajax/scorestrip?'
if stype == 'POST':
week += 17
if week == 21: # NFL.com you so silly
week += 1
return '%sseason=%d&seasonType=%s&week=%d' % (xmlurl, year, stype, week)
Something like: http://www.nfl.com/ajax/scorestrip?season=2014&seasonType=REG&week=1
Thanks @ochawkeye.
@cmosguy Everything with respect to nflgame
(that I've written) is open source. So it's all there. If you're curious where other stuff has come from, just ask. :-)
@ochawkeye @BurntSushi this is so great thanks for your help with this! BTW, just curious, have you ever figured out how to pull scores for all the NCAA football games?
@cmosguy Nope. Never really looked into it.
You can get scores and many other stats here: http://sportsdatabase.com/ncaafb/query. There's an API, too--pretty great site.
I was curious how did you get the schedule for all the games:
https://github.com/BurntSushi/nflgame/blob/master/nflgame/schedule.json