Flight deal monitoring script that watches SecretFlying.com for deals to specific airports and sends email notifications.
- Monitors flight deals for LAX (Los Angeles) and BWI (Baltimore) airports
- Secure email configuration via environment variable
- Duplicate detection to avoid spam
- Error handling and logging
- Automatic cleanup of temporary files
The script uses an environment variable for the email address to avoid hardcoding sensitive information. The email address is stored as a global environment variable on the system.
-
Make the script executable:
chmod +x aircheck.sh
-
Email address is configured globally:
- The email address must be stored in
~/.bashrcand~/.profile - To set it, edit the
AIRCHECK_EMAILvariable in~/.bashrc:export AIRCHECK_EMAIL="your-email@example.com"
- Then reload your shell configuration:
source ~/.bashrc
The script will automatically use this global variable. No need to export it each time you run the script. Note: The email address is not stored in any script files for security.
- The email address must be stored in
-
Ensure you have a mail client configured on your system:
mailcommand (usually viamailutilsormailx)- Or
sendmailcommand
Run the script:
./aircheck.shFor automated monitoring, add to crontab:
# Run every 6 hours
0 */6 * * * cd /path/to/AirCheck && ./aircheck.sh >> aircheck.log 2>&1aircheck.sh- Main monitoring scriptexclude.txt- Tracks already-notified deals (auto-created)Final.txt- Latest parsed flight deal data
- LAX - Los Angeles International Airport
- BWI - Baltimore/Washington International Airport
The script searches for these airport codes and common city name variations in deal titles.