Share mytime.target.com schedule by email
Note: This script is buggy, and as I no longer work at target, I will not be maintaning it 🥲
- Python 3.10.11
- Chrome (Browser must be installed)
- ChromeDriver (check notes)
- Conda: https://docs.conda.io/projects/miniconda/en/latest/
- You may need to update "chromedriver.exe" to a version that matches your chrome install
- You can find the current chrome version by: chrome://settings/help -> "Version"
- You can download the latest driver here: https://googlechromelabs.github.io/chrome-for-testing/#stable or https://chromedriver.chromium.org/downloads
- Make sure to get the 32-bit version of the driver.
- Replace "chromedriver.exe" in the main directory.
- Clone the repository or download the script.
git clone https://github.com/YelloNox/Target-MyTime-To-Email
- Run
setup.bat
or install the script with the following commands:
conda create --prefix ./conda-env python=3.10.11
conda activate ./conda-env
pip install -r requirements.txt
-
Clone
example.env
to.env
. -
Edit the
.env
and update the following variables:target_username = "target_user_username" target_password = "target_user_password"
receiver_emails = "["email_1", "email_2"]" subject = "Target Schedule"
smtp_username = "enter_email" smtp_password = "enter_password"
- Run the script with
run.bat
or:
conda activate ./conda-env
python run.py
- The script will perform the following steps:
- Check the last modification date of a file.
- Prompt the user to continue or exit based on the file's modification date.
- Initialize a Chrome driver and open a specified URL.
- Perform login and verification steps if necessary.
- Scrape the web page and save the schedule to a file.
- Send the saved schedule via email.
- Follow the prompts in the terminal to proceed or exit.
To obtain the SMTP server details for Google email, follow these steps:
- Go to your Google Account settings.
- Navigate to the "Security" tab.
- Scroll down and enable "Less secure app access".
- Go back to the main settings page and click on "Account info".
- Scroll down to the "Sign-in & security" section and click on "App passwords".
- Select the app you want to generate an app password for (e.g., "Mail" or "Other (Custom name)").
- Follow the instructions to generate an app password.
- Use your personal email as the
smtp_user
in the.env
file - Use the generated app password as the
smtp_password
in the.env
file. - Obtain the SMTP Server Port Number:
- The SMTP server port number is specific to your email service provider. Here are some common port numbers:
- Gmail: Port 587 or 465 (TLS/SSL)
- Outlook.com/Hotmail.com: Port 587 or 25
- Yahoo Mail: Port 587 or 465 (SSL)
- AOL Mail: Port 587 or 465 (SSL)
- Office 365: Port 587 or 25
- To find the SMTP server port number for your email provider, you can refer to their documentation or support resources.
- Once you have the port number, update the
smtp_port
variable in the.env
file, replacing###
with the appropriate port number.
- The SMTP server port number is specific to your email service provider. Here are some common port numbers:
Target MyTime To Email by Alec Murphy is licensed under CC BY-NC 4.0