This project is designed to monitor the availability of seats in a specified class at Arizona State University (ASU). If seats become available, the program sends an email and SMS notification to the specified recipient.
- Periodically checks the availability of seats in a specified class.
- Sends email notifications when seats are available.
- Validates input data and email addresses.
- Supports sending SMS notifications via email to different carriers.
- Python 3.x
- The following Python packages:
requestsPyYAML
- An email account to send notifications from.
-
Clone the repository:
git clone https://github.com/yourusername/class-seat-notifier.git cd class-seat-notifier -
Install the required Python packages:
pip install -r requirements.txt
-
Create a
config.jsonfile in the project directory with the following format:{ "classnum": "12345", "phone_number": "1234567890", "carrier": "AT&T", "email_id": "your_email@example.com" } -
Create a
credentials.yamlfile in the project directory with your email credentials:user: "your_email@example.com" password: "your_password"
Run the script using the following command:
python main.pyOR
python3 main.pyThe script will continuously check the availability of seats in the specified class. When seats become available, it will send an email notification to the specified recipient and stop checking.
classnum: The 5-digit class number to monitor.phone_number: The 10-digit phone number to receive SMS notifications.carrier: The carrier of the phone number (must be one of the supported carriers).email_id: The email address to receive notifications.
user: The email address to send notifications from.password: The password for the email account.
The following carriers are supported for SMS notifications:
- AT&T
- Sprint
- T-Mobile
- Verizon Wireless
- Virgin Mobile
- Rogers Wireless
- Boost Mobile
- Telus Mobility
- Airfire Mobile
- Ameritech
- Assurance Wireless
- BellSouth
- Bluegrass Cellular
- Cellcom
- Cellular South
- Chariton Valley Wireless
- Chat Mobility
- Cleartalk
- Consumer Cellular
- Cricket
- Element Mobile
- Esendex
- Mellon Mobile
- MetroPCS
- Nextech
- Page Plus Cellular (Verizon MVNO)
- South Central Communications
- Southernlinc
- Straight Talk
- Syringa Wireless
- Teleflip
- Union Wireless
- US Cellular
- Voyager Mobile
- Centennial Wireless
- TracFone (prepaid)
Fetches the class information for a given class number.
Args:
class_num(str): The class number to fetch information for.
Returns:
int: The number of available seats in the class.
Reads and validates input data from the config.json file.
Returns:
list: A list containing class number, phone number, carrier, and email ID.
Raises:
ValueError: If the input data is not valid.
Gets email credentials from a YAML file.
Args:
filepath(str): The path to the credentials YAML file.
Returns:
tuple: A tuple containing the email address and password.
Raises:
Exception: If there is an error loading the credentials file.
Sends an email notification that a class is open.
Args:
email_id(str): The recipient's email address.class_num(str): The class number to include in the email.
Raises:
Exception: If there is an error sending the email.
Main function to check class availability and send notifications.
This project is licensed under the MIT License.
Feel free to open issues and submit pull requests if you have any suggestions or improvements.