Skip to main content

NBA

What

The NBA segment allows you to display the scheduling and score information for your favorite NBA team!

Sample Configuration

In order to use the NBA segment, you need to provide a valid team tri-code that you'd like to get data for inside of the configuration. For example, if you'd like to get information for the Los Angeles Lakers, you'd need to use the "LAL" tri-code.

This example uses "LAL" to get information for the Los Angeles Lakers. It also sets the foreground and background colors to match the theming for the team. If you are interested in getting information about specific foreground and background colors you could use for other teams, you can explore some of the color schemes here.

It is recommended that you set the HTTP timeout to a higher value than the normal default in case it takes some time to gather the scoreboard information. In this case we have the http_timeout set to 1500.

{
"background": "#e9ac2f",
"foreground": "#8748dc",
"leading_diamond": "",
"style": "diamond",
"trailing_diamond": "",
"type": "nba",
"properties": {
"team": "LAL",
"http_timeout": 1500
}
}

Properties

NameTypeDescription
teamstringtri-code for the NBA team you want to get data for
days_offsetinthow many days in advance you wish to see that information for, defaults to 8
http_timeoutintHow long do you want to wait before you want to see your prompt more than your sugar? I figure a half second is a good default - defaults to 500ms

Template (info)

default template
\U000F0806 {{ .HomeTeam}}{{ if .HasStats }} ({{.HomeTeamWins}}-{{.HomeTeamLosses}}){{ end }}{{ if .Started }}:{{.HomeScore}}{{ end }} vs {{ .AwayTeam}}{{ if .HasStats }} ({{.AwayTeamWins}}-{{.AwayTeamLosses}}){{ end }}{{ if .Started }}:{{.AwayScore}}{{ end }} | {{ if not .Started }}{{.GameDate}} | {{ end }}{{.Time}}

Properties

NameTypeDescription
.HomeTeamstringhome team for the upcoming game
.AwayTeamstringaway team for the upcoming game
.Timestringtime (EST) that the upcoming game will start
.GameDatestringdate the game will happen
.StartTimeUTCstringtime (UTC) the game will start
.GameStatusintegerinteger, 1 = scheduled, 2 = in progress, 3 = finished
.HomeScoreintscore of the home team
.AwayScoreintscore of the away team
.HomeTeamWinsintnumber of wins the home team currently has for the season
.HomeTeamLossesintnumber of losses the home team currently has for the season
.AwayTeamWinsintnumber of wins the away team currently has for the season
.AwayTeamLossesintnumber of losses the away team currently has for the season
.Startedbooleanif the game was started or not
.HasStatsbooleanif the game has game stats or not