Skip to content

KaranBhaskar/course_notifier

Repository files navigation

⚡ Course Notifier - Never Miss a Spot Again!

Stop refreshing course pages like it's 2010! This intelligent, battle-tested Python application automatically hunts for open spots in your dream courses at Ontario Tech University and instantly alerts you via SMS the moment seats become available. Powered by cutting-edge Selenium web automation, Twilio's reliable SMS infrastructure, and smart scheduling with APScheduler.

🚀 Why This Will Save You HOURS

Time is money, and this tool gives you both back! Instead of:

  • ❌ Manually checking course pages every 15 minutes
  • ❌ Setting 10 alarms throughout the day
  • ❌ Losing sleep worrying about missing registration windows
  • ❌ Missing out on popular courses that fill up in seconds

You get:

  • Automated 24/7 Monitoring - Works while you sleep, study, or binge Netflix
  • Instant SMS Alerts - Get notified in seconds, not minutes
  • Zero Manual Effort - Set it and forget it!
  • Peace of Mind - Focus on what matters while the bot does the watching

✨ Power-Packed Features

  • 🔍 Smart Course Tracking: Continuously monitors multiple courses simultaneously at custom intervals
  • 📱 Lightning-Fast SMS Alerts: Real-time Twilio notifications delivered straight to your phone
  • 🌐 Intelligent Web Scraping: Bulletproof Selenium automation with Chrome for 99.9% reliability
  • ⚙️ Super Configurable: Customize everything via simple environment variables - no coding needed!
  • 📊 Professional Logging: Track every check with detailed, color-coded logs
  • 🔄 Graceful & Clean: Proper startup/shutdown with automatic resource management
  • 🛡️ Industrial-Strength Error Handling: Self-recovers from failures and keeps running
  • 🎯 Duplicate Prevention: Won't spam you with repeated notifications for the same course

🎯 Get Started in 3 Minutes!

What You'll Need

  • Python 3.8+ (the newer, the better!)
  • Chrome or Chromium browser
  • Free Twilio account (takes 2 minutes to setup)
  • Your university login credentials

Installation - Lightning Fast ⚡

  1. Grab the code and jump in:
git clone https://github.com/KaranBhaskar/course_notifier
cd course_notifer
  1. Set up your configuration:
cp .env.example .env
# Edit .env with your credentials (Twilio, university login, course codes)
  1. Launch and let it work its magic:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py  # 🎉 You're live!

⚙️ Configuration Made Simple

All configuration is done through environment variables in a .env file:

  1. Copy the example file: cp .env.example .env
  2. Edit .env with your actual values
  3. Check .env.example for detailed comments on each setting

🎫 Getting Your Twilio Credentials (Super Easy!)

  1. Head to twilio.com and grab a free account
  2. Snag your Account SID and Auth Token from the dashboard (big red button, can't miss it!)
  3. Get a phone number (free trial number works perfectly for testing)
  4. Add your cell number to receive those sweet, sweet notifications

📝 What You Need to Configure

  • Twilio credentials (SID, Token, phone numbers)
  • Course codes to monitor
  • Check interval (how often to scan)
  • University login credentials
  • Optional: Browser settings, logging preferences

See .env.example for the complete list with detailed descriptions!

📖 How To Use This Beast

It's Stupid Simple

  1. Drop your credentials and course codes into the .env file
  2. Fire up the app with python app.py
  3. Watch the magic happen! The bot will:
    • 🏃‍♂️ Check course availability immediately
    • ⏰ Keep monitoring on autopilot at your chosen interval
    • 📲 Blast you an SMS the instant a spot opens up
    • 📝 Log everything so you can see exactly what's happening

🎨 Customize For Any University

Got a different school? No problem! The scraper is designed to be university-agnostic. Just tweak a few things:

  1. Update URLs in config.py:

    • Change BASE_URL to match your school's course search page
    • Adjust format_course_url() in helpers.py if your URLs are structured differently
  2. Modify HTML Parsing in course_scraper.py:

    • Update the check_course() method to target your university's specific HTML structure
    • Tweak the regex patterns that extract seat numbers
  3. Adapt Login Flow (if your school requires it):

    • Modify login_if_needed() with the correct form selectors
    • Add your credentials to the environment variables

🏷️ Course Code Examples (Works With Any Format!)

Every university has its own style - we've got you covered:

# Ontario Tech style
COURSE_CODES=CSCI2010,MATH1010U

# Simple numeric codes
COURSE_CODES=CS101,MATH205,PHYS301

🏗️ Clean, Professional Architecture

Built with best practices and modularity in mind:

course_notifier/
├── config.py          # 🎛️ All your settings in one place
├── helpers.py         # 🔧 Helper functions and logging magic
├── course_scraper.py  # 🕷️ Selenium-powered web scraping engine
├── sms_notifier.py    # 📱 Twilio SMS notification system
├── course_monitor.py  # ⏱️ Smart job scheduling orchestrator
├── app.py            # 🚀 Launch pad for the entire system
├── requirements.txt   # 📦 All dependencies listed

💎 Core Components That Make It Tick

  • CourseScraper: Your tireless web-scraping robot using Selenium and Chrome
  • NotificationService: Smart Twilio integration with built-in spam prevention
  • CourseMonitor: The brain of the operation - coordinates everything with APScheduler
  • Configuration: Bulletproof config management with built-in validation

🔒 Security First, Always

  • Keep .env sacred - never commit it to version control!
  • Use environment variables in production - no hardcoded secrets!
  • Rotate credentials regularly - security 101
  • Chrome profile saves login state - convenient AND secure
  • Update dependencies often - patch those vulnerabilities!

⚠️ Heads Up: This tool is for educational purposes and personal use. Always respect your university's terms of service and don't hammer their servers. Be a good digital citizen! Use responsibly and ethically.

🎉 Pro Move: Star this repo if it saves you time - it helps others discover it too!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages