Countdown to NFL kickoff


#21

I’ll try with LAR

Aren’t all supposed to have three letters?

teams = [
    ['ARI', 'Arizona', 'Cardinals', 'Arizona Cardinals'],
    ['ATL', 'Atlanta', 'Falcons', 'Atlanta Falcons'],
    ['BAL', 'Baltimore', 'Ravens', 'Baltimore Ravens'],
    ['BUF', 'Buffalo', 'Bills', 'Buffalo Bills'],
    ['CAR', 'Carolina', 'Panthers', 'Carolina Panthers'],
    ['CHI', 'Chicago', 'Bears', 'Chicago Bears'],
    ['CIN', 'Cincinnati', 'Bengals', 'Cincinnati Bengals'],
    ['CLE', 'Cleveland', 'Browns', 'Cleveland Browns'],
    ['DAL', 'Dallas', 'Cowboys', 'Dallas Cowboys'],
    ['DEN', 'Denver', 'Broncos', 'Denver Broncos'],
    ['DET', 'Detroit', 'Lions', 'Detroit Lions'],
    ['GB', 'Green Bay', 'Packers', 'Green Bay Packers', 'G.B.', 'GNB'],
    ['HOU', 'Houston', 'Texans', 'Houston Texans'],
    ['IND', 'Indianapolis', 'Colts', 'Indianapolis Colts'],
    ['JAX', 'Jacksonville', 'Jaguars', 'Jacksonville Jaguars', 'JAX'],
    ['KC', 'Kansas City', 'Chiefs', 'Kansas City Chiefs', 'K.C.', 'KAN'],
    ['LA', 'Los Angeles', 'Rams', 'Los Angeles Rams', 'L.A.'],
    ['MIA', 'Miami', 'Dolphins', 'Miami Dolphins'],
    ['MIN', 'Minnesota', 'Vikings', 'Minnesota Vikings'],
    ['NE', 'New England', 'Patriots', 'New England Patriots', 'N.E.', 'NWE'],
    ['NO', 'New Orleans', 'Saints', 'New Orleans Saints', 'N.O.', 'NOR'],
    ['NYG', 'Giants', 'New York Giants', 'N.Y.G.'],
    ['NYJ', 'Jets', 'New York Jets', 'N.Y.J.'],
    ['OAK', 'Oakland', 'Raiders', 'Oakland Raiders'],
    ['PHI', 'Philadelphia', 'Eagles', 'Philadelphia Eagles'],
    ['PIT', 'Pittsburgh', 'Steelers', 'Pittsburgh Steelers'],
    ['LAC', 'Los Angeles', 'Chargers', 'Los Angeles Chargers', 'L.A.', 'LAC'],
    ['SEA', 'Seattle', 'Seahawks', 'Seattle Seahawks'],
    ['SF', 'San Francisco', '49ers', 'San Francisco 49ers', 'S.F.', 'SFO'],
    ['TB', 'Tampa Bay', 'Buccaneers', 'Tampa Bay Buccaneers', 'T.B.', 'TAM'],
    ['TEN', 'Tennessee', 'Titans', 'Tennessee Titans'],
    ['WAS', 'Washington', 'Redskins', 'Washington Redskins', 'WSH'],
]

#22

Fails with LAR:

Downloading team rosters…
17/32 complete. (53.12%)Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/nflgame/update_players.py”, line 501, in
run()
File “/usr/local/lib/python2.7/dist-packages/nflgame/update_players.py”, line 415, in run
tbodys = soup.find(id=‘result’).find_all(‘tbody’)
AttributeError: ‘NoneType’ object has no attribute 'find_all’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):


#23

Yeah - consistency with team abbreviations was never the strong suit of the NFL :grimacing:


#24

Fixed it for you :wink:


#25

Are you guys in the in-market zone of your favorite teams?!


#26

Being in Canada, I guess I’ll have to say no :slight_smile:


#27

Meaning I am from Kansas City and I want to know about the Kansas City chiefs? Then yes I am


#28

More on the - are you in the right market to watch your fav team on TV? NFL partners (CBS, FOX, ESPN, etc) usually broadcast in-market games only. I am a Pats fan and it’s hard to watch them in Florida - there are three teams in Florida and the chances that one of them has a game at the same time as the Pats is so high that we seldomly get NE games here.


#29

Ok gotcha. Then yes I am


#30

Yes


#31

Gotcha… would have to test where it spots me. Local US feeds I get in Canada are Burlington VT and Plattsburgh NY. I guess closest market is NE, which would be my fav team yeah.


#32

BTW - in case you ever consider (or someone asks about) doing the same for MLB, let me know. I can point you to a very reliable and well formatted XML data source :wink:


#33

Made a bit of progress, restructured the data a bit, brought it into webCoRE - some caching may need to be done though so the piston does not keep requesting stuff - at least the team names for example

(expression) $nfl.ne »»» (dynamic) [games:[57379:[gamekey:57379, home:DEN, away:NE, time:8:30, wday:Sun, season_type:REG, month:11, year:2017, day:12, eid:2017111211, meridiem:PM, week:10], 57441:[gamekey:57441, home:MIA, away:NE, time:8:30, wday:Mon, season_type:REG, month:12, year:2017, day:11, eid:2017121100, meridiem:PM, week:14], 57480:[gamekey:57480, home:NE, away:NYJ, time:1:00, wday:Sun, season_type:REG, month:12, year:2017, day:31, eid:2017123106, meridiem:PM, week:17], 57345:[gamekey:57345, home:NE, away:LAC, time:1:00, wday:Sun, season_type:REG, month:10, year:2017, day:29, eid:2017102903, meridiem:PM, week:8], 57206:[gamekey:57206, home:DET, away:NE, time:7:00, wday:Fri, season_type:PRE, score:[away:30, home:28, display:NE (30) at DET (28)], month:8, year:2017, day:25, eid:2017082551, meridiem:PM, week:3], 57229:[gamekey:57229, home:NE, away:NYG, time:7:30, wday:Thu, season_type:PRE, score:[away:40, home:38, display:NYG (40) at NE (38)], month:8, year:2017, day:31, eid:2017083162, meridiem:PM, week:4], 57256:[gamekey:57256, home:NO, away:NE, time:1:00, wday:Sun, season_type:REG, month:9, year:2017, day:17, eid:2017091705, meridiem:PM, week:2], 57234:[gamekey:57234, home:NE, away:KC, time:8:30, wday:Thu, season_type:REG, month:9, year:2017, day:7, eid:2017090700, meridiem:PM, week:1], 57190:[gamekey:57190, home:HOU, away:NE, time:8:00, wday:Sat, season_type:PRE, score:[away:23, home:27, display:NE (23) at HOU (27)], month:8, year:2017, day:19, eid:2017081956, meridiem:PM, week:2], 57413:[gamekey:57413, home:BUF, away:NE, time:1:00, wday:Sun, season_type:REG, month:12, year:2017, day:3, eid:2017120302, meridiem:PM, week:13], 57339:[gamekey:57339, home:NE, away:ATL, time:8:30, wday:Sun, season_type:REG, month:10, year:2017, day:22, eid:2017102212, meridiem:PM, week:7], 57290:[gamekey:57290, home:NE, away:CAR, time:1:00, wday:Sun, season_type:REG, month:10, year:2017, day:1, eid:2017100107, meridiem:PM, week:4], 57401:[gamekey:57401, home:NE, away:MIA, time:1:00, wday:Sun, season_type:REG, month:11, year:2017, day:26, eid:2017112604, meridiem:PM, week:12], 57391:[gamekey:57391, home:OAK, away:NE, time:4:25, wday:Sun, season_type:REG, month:11, year:2017, day:19, eid:2017111909, meridiem:PM, week:11], 57318:[gamekey:57318, home:NYJ, away:NE, time:1:00, wday:Sun, season_type:REG, month:10, year:2017, day:15, eid:2017101505, meridiem:PM, week:6], 57274:[gamekey:57274, home:NE, away:HOU, time:1:00, wday:Sun, season_type:REG, month:9, year:2017, day:24, eid:2017092407, meridiem:PM, week:3], 57454:[gamekey:57454, home:PIT, away:NE, time:4:25, wday:Sun, season_type:REG, month:12, year:2017, day:17, eid:2017121709, meridiem:PM, week:15], 57464:[gamekey:57464, home:NE, away:BUF, time:1:00, wday:Sun, season_type:REG, month:12, year:2017, day:24, eid:2017122404, meridiem:PM, week:16], 57298:[gamekey:57298, home:TB, away:NE, time:8:25, wday:Thu, season_type:REG, month:10, year:2017, day:5, eid:2017100500, meridiem:PM, week:5], 57183:[gamekey:57183, home:NE, away:JAX, time:7:30, wday:Thu, season_type:PRE, score:[away:31, home:24, display:JAX (31) at NE (24)], month:8, year:2017, day:10, eid:2017081057, meridiem:PM, week:1]], full:New England Patriots, name:Patriots, loc:New England]
(expression) $nfl.ne.thursday »»» (dynamic) [gamekey:57234, home:NE, away:KC, time:8:30, wday:Thu, season_type:REG, month:9, year:2017, day:7, eid:2017090700, meridiem:PM, week:1]
(expression) $nfl.ne.thursday.away »»» (dynamic) KC
(expression) $nfl.ne.thursday.home + ' @ ' + $nfl.ne.thursday.away »»» (string) NE @ KC

So far I’ve made these:

$nfl.< team ID > returns an object that has the following:

  • id = the id of the team, same as teamID used
  • name = short name of the team, i.e. Patriots
  • loc = location of the team i.e. New England
  • full = full name of the team, i.e. New England Patriots
  • games - a list of all known games and their scores (for those played)

each game contains:

  • gamekey = a numeric ID for the game, may be used later
  • home = ID of the home team
  • away = ID of the away team
  • day = day of the month
  • month = month
  • year = duh
  • wday = the day of the week
  • eid = the id of the game (may be used later)
  • time = time in local timezone of the home team of game start
  • meridiem = AM/PM for the time above
  • season_type = the season type, PRE for preseason, REG for regular, POST for playoffs/sb
  • week = the week of the season described above, PRE has weeks 1-4, REG has weeks 1-17, POST has weeks 1-4 when 1 = wildcards, 4 = superbowl

Special keywords:

$nfl.< team ID >.today < returns today’s game, if any
$nfl.< team ID >.tomorrow < returns tomorrow’s game, if any
$nfl.< team ID >.monday…sunday < returns the game on that day of the week (current week)
$nfl.< team ID >.mon…sun < returns the game on that day of the week (current week) - same as above, but short codes for days

I’ll need to publish the smartapp before you can play with these. Coming soon.

There will also be an option for

$nfl.< team ID >.now <<< returns the game currently being played, if any


#34

That’s very exciting! Thanks a lot!


#35

so I guess more special keywords should be:

$nfl.< team ID >.next = next game - not sure what next should return during a game, is it the current game or next? I am siding with the real next game, so next would be today’s game up until a few minutes before the game, then switches over to next week’s

$nfl.< team ID >.thisWeek - this week’s game?
$nfl.< team ID >.nextWeek - next week’s game?

$nfl.< team ID >.previous < previous game, I guess this is last week’s until the game ends, then that game that just ended becomes previous?

Are there any game statistics needed? I am guessing about the current game, I should try and fetch the quarter, possession (which team is driving), down #, yards? I’ll try and get as much as I can. I technically have info about each play and I can technically check if a player is playing, or how many points he scored, or how many yards, etc. Not sure if that is useful in any way for an HA system. I think the most important parts are being able to tell:

  1. there’s a game today
  2. the game started
  3. my team scored
  4. the other team scored / score change
  5. the game ended
  6. we won
  7. we lost (boo)
  8. when’s the next game

Right?


#36

“This week” is tricky - does this mean calendar week (starting on which day - Monday or Sunday?) or NFL schedule week (i.e., Thursday through Monday)? Same holds for next week as well…


#37

I thought NFL’s week starts Monday and ends Sunday and I accounted for that. Is their schedule a Tue(Thu) through Mon?


#38

@ahndee is spot on. An NFL “week” is Tuesday to Monday, with games being played Thursday, Sunday and Monday.

There’s 17 weeks in the regular season, 4 in preseason.


#39

IIRC, there’s also the occasional Saturday game later in the season…


#40

That reminds me of something too… maybe it was when Christmas was on Sunday?