Sports Team Alerts


#1

As a follow-up to my Scoreboard Pistons found here. I have posted a piston below for individual team alerts.

The current piston sends push notification prior to game, with each team score, and final. Due to the numerous other methods of notifications (i.e TTS via echo/google/sonos or even flashing lights), I did not include those options by default. Feel free to swap out the push notification with any individualized method. For example, I use the cast-web-api to announce the alert over google home based on certain conditions.

    Piston Logic:
  • To allow for as many sports as possible, user will need to set specific varaibles
    • Sport Index (0-Baseball, 1-Football, 2-Basketball, 3-Hockey, 4-Soccer)
    • Team Abbreviation found on ESPN.com
    • Professional Boolean (True = Pro, False = College)
    • Gender Boolean (True = Male; False = Female)
    • League ID for Professional Soccer Only
  • Alert Preferences: Set to true if you want to receive that alert
  • Pre-game Alert Offset - how far in advance to send the pregame alert
*Do not edit any other variables*

  • The piston will run every 5 minutes but only make the API call based on certain conditions. The top webrequest pulls high level data: team info and eventID. Event ID is passed to the second webrequest to get specific game information.
  • The high level webrequest is only completed 4 times a day to prevent spamming the API.
  • The secondary webrequest is only completed if the high level request indicates that the game is live (or about to start = after pre-game alert).
  • Ultimately this means that alerts are not live but will be received at 5 min intervals


  • Sports Scoreboard (American Football for now)