Countdown to NFL kickoff


#41

Not just Christmas - this season’s schedule has two Saturdays with games:
44
53


#42

So should I make it Thu-Mon? Or not at all?


#43

It should cover a full week - otherwise what will happen on Tue & Wed? I probably would make it Wed through Tue (local time) - that way people on the other side of the world can get recent results without having to do date math…


#44

But if today is Tuesday, and you say $nfl.ne.monday that should be next Monday, right? The Monday in the same “week” as today


#45

In my mind, yes.


#46

This feels a bit weird, week Wed through Tue:

(expression) $nfl.ne.lastweek »»» (dynamic) [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]
(expression) $nfl.ne.thisweek »»» (dynamic) [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]
(expression) $nfl.ne.nextweek »»» (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]

#47

The question is whether it will use local or US west coast weekdays. If I’m in Europe and following the NFL (both hypothetical :wink:), it would already be Tuesday by the time Monday night football is going on and most likely I would be more interested in the current game than the one for next week. The same thing obviously holds true for today


#48

I am comparing local hub datetime vs day of the week wed through tue - so if you’re in the UK and it’s Tue 1am and the Monday night game is still playing in the US, that would count as the same week, since Tuesday is included as the end of the current week - that’s why I went ahead and used Wed-Tue rather than Tue-Mon


#49

took the liberty of fixing some long-dreaded bugs:

!null == true
!!null == false
$nfl.ne.wed == null >>> true (it is null)

#50

I published this update this morning:

v0.2.0e7.20170906 - BETA M2 - Added support for the $nfl composite variable, fixed some bugs with boolean comparisons of null


#51

Thanks a lot @ady624, it’s really fun playing with it.

I stumbled upon one difficulty when trying to create one of my piston. I should have spotted it earlier but I kinda learn as I “code”.

When trying to make my speaker read out loud who’s the Pats playing against this week, it would help to have something like $nfl..thisweek.opp (opponent of team ID). I made a workaround but it’s not optimal I guess.


#52

Well, $nfl.ne.thisweek.away should return KC

Then you should be able to put that in a variable and use it as $nfl.teams[variable].full to get the full name of that team


#53

You need to update the smartapp again please - fixed the teams[…] being blacklisted

Then this will work:

The Pats are playing against the Kansas City Chiefs.


#54

Yeah but what if the Pats are playing at KC? Away will return NE, not KC right?


#55

Chiefs Nation!!! Oooooooooooooooooo


#56

As in…

(expression) $nfl.ne.thisweek.opponent.full »»» (dynamic) Kansas City Chiefs

#57

Added a few more things last night, things to try:

there are three modules so far:

  • teams - accessed by $nfl.teams.(teamID)

    $nfl.teams.NE
    $nfl.teams.NE.location >>> returns New England
    $nfl.teams.NE.name >>> returns Patriots
    $nfl.teams.NE.full >>> returns New England Patriots

  • schedule - accessed by $nfl.schedule

    $nfl.schedule.games.length
    $nfl.schedule.games[0]
    $nfl.schedule.games[0].home >>> returns the ID of the home team
    $nfl.schedule.games[0].away >>> returns the ID of the away team
    $nfl.schedule.games[0].played >>> returns true if the game was already played
    $nfl.schedule.games[0].score.home >>> returns the points scored by the home team
    $nfl.schedule.games[0].score.away >>> returns the points scored by the away team
    $nfl.schedule.games[0].score.display >>> returns the score in a nicely formatted way HM (0) - (0) AW

  • a single team, accessed by $nfl.(teamID), provides info about the team as well as its games

    $nfl.NE.played >>> returns the number of games played this season (preseason + regular + postseason)
    $nfl.NE.won >>> returns the number of games won this season (preseason + regular + postseason)
    $nfl.NE.tied >>> returns the number of games tied this season (preseason + regular + postseason)
    $nfl.NE.lost >>> returns the number of games lost this season (preseason + regular + postseason)
    $nfl.NE.preseason.played >>> returns the number of games played this preseason
    $nfl.NE.preseason.won >>> returns the number of games won this preseason
    $nfl.NE.preseason.tied >>> returns the number of games tied this preseason
    $nfl.NE.preseason.lost >>> returns the number of games lost this preseason
    $nfl.NE.regular.played >>> returns the number of games played this regular season
    $nfl.NE.regular.won >>> returns the number of games won this regular season
    $nfl.NE.regular.tied >>> returns the number of games tied this regular season
    $nfl.NE.regular.lost >>> returns the number of games lost this regular season
    $nfl.NE.postseason.played >>> returns the number of games played this postseason
    $nfl.NE.postseason.won >>> returns the number of games won this postseason
    $nfl.NE.postseason.tied >>> returns the number of games tied this postseason
    $nfl.NE.postseason.lost >>> returns the number of games lost this postseason
    $nfl.NE.yesterday >>> returns the game the team had yesterday, if any
    $nfl.NE.today >>> returns the game the team has today, if any
    $nfl.NE.tomorrow >>> returns the game the team has tomorrow, if any
    $nfl.NE.mon >>> returns the game the team has this NFL’s week Monday
    $nfl.NE.monday >>> returns the game the team has this NFL’s week Monday
    $nfl.NE.lastWeek >>> returns the game the team had last NFL’s week
    $nfl.NE.thisWeek >>> returns the game the team has this NFL’s week
    $nfl.NE.nextWeek >>> returns the game the team has next NFL’s week

For every game returned with any of the above methods, you get these options:

$nfl.NE.thisWeek.year >>> returns the year
$nfl.NE.thisWeek.month >>> returns the month
$nfl.NE.thisWeek.day >>> returns the day
$nfl.NE.thisWeek.wday >>> returns the week day, i.e. Thu
$nfl.NE.thisWeek.week >>> returns the week # of the current season, PRE, REG or POST
$nfl.NE.thisWeek.time >>> returns the time, i.e. 8:30
$nfl.NE.thisWeek.meridiem >>> returns AM or PM
$nfl.NE.thisWeek.season_type >>> returns the season type, one of PRE, REG, or POST
$nfl.NE.thisWeek.played >>> returns true if the game was already played
$nfl.NE.thisWeek.won >>> returns true if the game was won
$nfl.NE.thisWeek.tied >>> returns true if the game was tied
$nfl.NE.thisWeek.lost >>> returns true if the game was lost
$nfl.NE.thisWeek.score.home >>> returns the score of the home team
$nfl.NE.thisWeek.score.away >>> returns the score of the away team
$nfl.NE.thisWeek.score.display >>> formatted score
$nfl.NE.thisWeek.opponent.location >>> returns the location of the opponent team, i.e. Kansas City
$nfl.NE.thisWeek.opponent.name >>> returns the short name of the opponent team, i.e. Chiefs
$nfl.NE.thisWeek.opponent.full >>> returns the full name of the opponent team, i.e. Kansas City Chiefs


#58

You’re on fiya !! Nice addition :slight_smile:


#59

You might wanna add to the last list both $nfl.NE.thisweek.home and $nfl.NE.thisweek.away that are still working and useful. The list would then be complete :slight_smile:


#60

Any luck with the nfl integration? Any examples? :smiley: I am yet to get the live updates - still looking into ways of doing that to minimize time loss - trying to avoid polling, building some sort of subscription for push events…