Checks all of the Los Angeles sports teams scores each morning to see if any of them qualify for free Chick Fil A sandwiches and sends me an email as a reminder to check my app to claim the coupon
View Demo
·
Report Bug
·
Request Feature
The Los Angeles sports teams have agreements with Chick Fil A for free sandwiches if one of the following criteria is met
- Angels score 7 or more runs at home
- Ducks score 5 or more goals at home
- LAFC wins at home
This repo/service checks all of these criteria each day at 8 AM PT (3 PM UTC) using Python and Github Actions (for the automatic cron job) and sends me an email as a reminder to check my Chick Fil A app so I can claim my free Chick Fil A sandwich
- Python 3
-
Clone the repo
git clone https://github.com/CampAsAChamp/los-angeles-sports-chick-fil-a-scraper.git
-
Create virtual environment
python -m venv .venv
-
Activate virtual environment
source ./venv/Scripts/Activate
-
Download dependencies
pip install -r requirements.txt
-
Create .env file for secrets
mkdir env touch env/app.env nano env/app.env
Paste in the following content
FROM_EMAIL"<from_email_here>" TO_EMAIL="<to_emails_here>" PASSWORD="<gmail_app_password_here>" SHOULD_SEND_EMAIL=True USE_LOCAL=False
- The
USE_LOCAL
environment variable is if you want to use the local HTML pages inside the repo (in the/sample_pages/
directory), instead of fetching the actual live page.
- The
-
Run in VS Code by going to the "Run and Debug" tab on the side bar and clicking the green plus
▶️
If you want to set up for yourself to get email alerts here are the steps you need to follow:
NOTE: I've only tested this on Gmail accounts
- Fork this repo
- Set up an app password in your Google Account
- Follow this article to set one up https://support.google.com/accounts/answer/185833?hl=en
- Copy the app password somewhere safe as you'll be needing to put it in the Github Actions secrets
- In your newly forked repo add Github Actions secrets for the needed environment variables:
FROM_EMAIL
,TO_EMAIL
,PASSWORD
,SHOULD_SEND_EMAIL
, andUSE_LOCAL
-
Go to repo settings > Security > Secrets and Variables > Actions
-
Click
New Repository Secret
-
Add a separate one for each of the three keys listed above and paste the actual value that belong
-
For name use the key list above (
FROM_EMAIL
,TO_EMAIL
,PASSWORD
)-
TO_EMAIL
is a comma separated list of emails, so you can send email alerts to multiple people, or just keep it to one.TO_EMAIL = "[email protected]" OR TO_EMAIL = "[email protected], [email protected]"
-
-
For the value use the actual value of your email addresses or app password
-
- For
SHOULD_SEND_EMAIL
use the value -- True - For
USE_LOCAL
use the value -- False - It will now run every day, you can check the runs in the
Actions
tab in Github- If the criteria is met you will receive an email for each one met so you know to check your Chick Fil A app to claim your free sandwich coupon
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Change logic to use numerical for loop to be able to get previous game easier (current_index - 1)
Distributed under the MIT License. See LICENSE.txt
for more information.