Open ochawkeye opened 9 years ago
That seems pretty reasonable to me. Not sure exactly how to implement it. I guess you'd have to carry download time as part of the game json blob or something.
I do also run across this occasionally. For nfldb
it's a bit simpler because you can just wipe the entire last week and re-run nfldb-update
. :-)
Hmm - this nfldb
sounds interesting to me. Why have you not pushed me to move over to that before?
Haha :P
In a play late in Giants/Eagles game Monday night nfl.com initially had ruled something like Eli Manning ran for -4 yards, fumbled, E.Flowers picked it up and lost another 7 yards. At some point later, they changed this to a -11 yard pass with an illegal touch. I deleted the game on Tuesday and saw the change reflected in nflgame
. So far so good.
For game = '2015101900'
, playid '4346'
I now have:
(3:53) (Shotgun) E.Manning pass short middle to E.Flowers to NYG 39 for -11 yards (B.Graham) [B.Graham]. Penalty on NYG-M.Newhouse, Illegal Touch Pass, declined.'
I started to poke at the JSON looking for any clues and did notice right at the very end a tag nextupdate
. Now, I have no idea what this is supposed to be, but sounded interesting. I hadn't yet deleted either of the games referenced above, but gave those a shot tonight, interested in a) whether the play-by-play would actually update and b) whether the nextupdate
value would change.
import nflgame
plays = [('2015092009', 8, '1850'), ('2015100401', 20, '3773')] # game.eid, drive_num, playid
for play in plays:
game = nflgame.game.Game(play[0])
for d in game.drives:
if d.drive_num == play[1]:
print [p for p in d.plays if p.playid == play[2]][0]
print nflgame.game._get_json_data(eid=play[0])[-17:]
Pre-delete:
(SF, SF 45, Q2, 1 and 10) (4:47) (Shotgun) C.Hyde FUMBLES (Aborted) at SF 42, RECOVERED by PIT-R.Shazier at SF 42. R.Shazier to SF 42 for no gain (V.McDonald).
"nextupdate":266}
(OAK, CHI 49, Q4, 2 and 4) (9:45) L.Murray FUMBLES (Aborted) at CHI 44, RECOVERED by CHI-S.Acho at OAK 42. S.Acho to OAK 42 for no gain (J.Webb).
"nextupdate":352}
Post-delete:
(SF, SF 45, Q2, 1 and 10) (4:47) (Shotgun) C.Hyde FUMBLES (Aborted) at SF 42, RECOVERED by PIT-R.Shazier at SF 42. R.Shazier to SF 42 for no gain (V.McDonald).
"nextupdate":269}
(OAK, CHI 49, Q4, 2 and 4) (9:45) L.Murray FUMBLES (Aborted) at CHI 44, RECOVERED by CHI-S.Acho at OAK 42. S.Acho to OAK 42 for no gain (J.Webb).
"nextupdate":357}
Neither of the play-by-plays updated to what is shown on nfl.com as I had hoped (bummer), but the nextupdate
tag did change in both cases. What is that supposed to represent? Any ideas?
Maybe this is more an FYI or serves as a jumping off point to discussion...
I have caught some cases where the NFL has gone in after the fact and updated/corrected play by play information. Since json data gets cached and then never looked at again once the game is final, this would lead to different game files for someone that collected in real time vs. someone that ran
nflgame
after the corrections were made.---------------------------------------
I suspect if I delete those two games from
nflgame
and let them be pulled again they would fix themselves. I don't know if the NFL has a statute of limitations on how long after the play by play is posted that stat corrections can be changed, but I would imagine the window is pretty small. What are thoughts on doing a one-time drop & re-add for games after completion - say, one week after?