Get footy notifications about your favorite teams (via sms message)
This script uses TWILIO, a free sms-messaging gateway. Visit twilio.com, create an account, and get a twilio phone number! Once this is done, copy the twilio phone number, ACCOUNT SID, and AUTH TOKEN into the sportsCaster.py script.
Add all phone numbers that you wish to receive footy notifications to the TARGET_PHONE list.
- Visit https://www.espn.com/soccer/scoreboard
- Hit ctrl+u to see the source code
- Search for ‘slug’ with ctrl+f to find leagues
- Look for a league that you wish to add the the LEAGUE_CLUBS dictionary by searching through the instances of ‘slug’
- Add your league’s slug value to the dictionary
- Search for ‘shortDisplayName’ with ctrl+f to find clubs
- Add club’s shortDisplayName value to their appropriate leagues list
Automate notifications by using crontab. On the pi cmd window enter ‘crontab -e’ and at the bottom of the list that appears enter the time and date to execute a command. The format for adding items is as follows:
min hour day month day-of-the-week command
For example:
0 9 * * * sudo python3 sportsCaster.py # notifies you every day at 9:00 am
In the morning the scripts sends the fixtures for the day and the time the games occur.
In the afternoon the script sends results of the games of that day
Leave a Reply