An automated Twitter bot that monitors and posts live TSA checkpoint wait times at Hartsfield-Jackson Atlanta International Airport (ATL).
- π Automated Monitoring: Scrapes TSA wait times every 30 minutes
- π¦ Twitter Integration: Posts updates using Twitter API v2
- π¨ Visual Indicators: Color-coded emojis based on wait times
- π’ Green: β€ 15 minutes
- π‘ Yellow: 16-30 minutes
- π Orange: 31-45 minutes
- π£ Purple: 46-60 minutes
- π΄ Red: > 60 minutes
- π Secure: Environment-based credential management
- π Logging: Comprehensive logging with rotation
- π‘οΈ Resilient: Automatic retry logic and error handling
- π¦ Health Checks: Built-in health monitoring
- β‘ Graceful Shutdown: Proper signal handling
- Python 3.8 or higher
- Twitter Developer Account with API access
- Twitter API credentials (API Key, API Secret, Access Token, Access Token Secret)
git clone https://github.com/Rutherford/TSA-Wait-Times.git
cd TSA-Wait-Timespython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtcp .env.example .envEdit the .env file and add your Twitter API credentials:
TWITTER_API_KEY=your_actual_api_key
TWITTER_API_SECRET=your_actual_api_secret
TWITTER_ACCESS_TOKEN=your_actual_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_actual_access_token_secretpython time2wait.pydocker build -t tsa-wait-times-bot .
docker run -d --name tsa-bot --env-file .env tsa-wait-times-botsudo cp tsa-bot.service /etc/systemd/system/
sudo systemctl enable tsa-bot
sudo systemctl start tsa-bot
sudo systemctl status tsa-bot| Variable | Required | Default | Description |
|---|---|---|---|
TWITTER_API_KEY |
Yes | - | Twitter API Consumer Key |
TWITTER_API_SECRET |
Yes | - | Twitter API Consumer Secret |
TWITTER_ACCESS_TOKEN |
Yes | - | Twitter Access Token |
TWITTER_ACCESS_TOKEN_SECRET |
Yes | - | Twitter Access Token Secret |
SCRAPE_INTERVAL_MINUTES |
No | 30 | Minutes between updates |
REQUEST_TIMEOUT_SECONDS |
No | 10 | HTTP request timeout |
MAX_RETRIES |
No | 3 | Max retry attempts for failed requests |
Logs are written to:
- Console: INFO level and above
- File:
tsa_bot.log(DEBUG level, rotated at 10MB, 5 backups)
TSA-Wait-Times/
βββ time2wait.py # Main bot application
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variable template
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββ Dockerfile # Docker container configuration
βββ tsa-bot.service # Systemd service file
βββ tests/ # Unit tests
β βββ __init__.py
β βββ test_bot.py
β βββ test_scraping.py
βββ docs/ # Additional documentation
# Install development dependencies
pip install -r requirements.txt
# Run tests with coverage
pytest --cov=time2wait tests/
# Run specific test file
pytest tests/test_bot.py -v# Format code
black time2wait.py
# Lint code
pylint time2wait.py
# Type checking
mypy time2wait.py- Check credentials: Ensure all Twitter API credentials are correctly set in
.env - Check permissions: Verify your Twitter app has read/write permissions
- Check logs: Review
tsa_bot.logfor detailed error messages
- The bot includes automatic retry logic with exponential backoff
- Check your internet connection
- Verify the ATL website is accessible: https://www.atl.com/times/
- Rate Limits: The bot respects Twitter's rate limits
- Authentication: Ensure your credentials are valid and not expired
- Permissions: Your Twitter app needs read/write access
.env file to version control
- Always use
.envfor sensitive credentials - Rotate your API keys periodically
- Use environment-specific credentials for development/production
- Review Twitter API logs regularly for unusual activity
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- TSA wait times data provided by Hartsfield-Jackson Atlanta International Airport
- Twitter API integration via Tweepy
For issues, questions, or suggestions:
- Open an Issue
- Check existing Discussions
- β Complete rewrite with production-grade architecture
- β Removed hardcoded credentials (now uses environment variables)
- β Added comprehensive error handling and retry logic
- β Implemented proper logging with rotation
- β Added graceful shutdown handling
- β Switched to Tweepy for Twitter API integration
- β Added health checks and monitoring
- β Removed unused OpenAI dependency
- β Added Docker and systemd support
- β Comprehensive documentation and tests
- Initial release with basic functionality