An automated bot that books Pilates sessions on Acuity Scheduling for "Midday Flow" classes every Monday, Thursday, and Saturday at 3:40 PM.
- Automated Booking: Books sessions for the upcoming week automatically
- Smart Scheduling: Runs every Monday at 12:01 AM (Vietnam time) to secure spots 1 week in advance
- Alternative Session Detection: Finds alternative times if preferred slot is unavailable
- Telegram Notifications: Sends alerts for successful bookings, alternatives needing confirmation, or errors
- Robust Error Handling: Comprehensive logging and error recovery
- Configurable: Easy to customize via YAML configuration file
- Python 3.8 or higher
- Internet connection
- (Optional) Telegram account for notifications
-
Clone or navigate to the repository:
cd pilatesbot -
Install Python dependencies:
pip install -r requirements.txt
-
Install Playwright browsers:
playwright install chromium
-
Configure the bot:
- Review and modify
config.yamlif needed (user info is already set) - Copy
.env.exampleto.envand add your Telegram credentials (optional):cp .env.example .env nano .env # Edit with your credentials
- Review and modify
The main configuration file contains:
- booking_url: Acuity Scheduling URL (pre-configured)
- user_info: Name, phone, email (already set for Thoon Nay)
- session: Class name ("Midday Flow"), time (3:40 PM), days (Mon/Thu/Sat)
- booking: Settings for advance booking, alternatives, confirmations
- browser: Headless mode and timeout settings
- timezone: Set to Asia/Ho_Chi_Minh (Vietnam)
To enable Telegram notifications:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts to create your bot - Save the Bot Token provided by BotFather
- Start a chat with your bot and send any message
- Get your Chat ID from:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates - Update
.envwith your credentials:TELEGRAM_BOT_TOKEN=your_bot_token_here TELEGRAM_CHAT_ID=your_chat_id_here ENABLE_NOTIFICATIONS=true - Test notifications:
python3 test_telegram.py
See DEPLOYMENT_GUIDE.md for detailed instructions.
Run the bot manually to test or book sessions immediately:
python3 pilates_bot.pyThe bot will:
- Calculate target dates for next week (Mon, Thu, Sat)
- Open a browser and navigate to Acuity Scheduling
- Select "Midday Flow" class
- Book sessions at 3:40 PM for each day
- Fill in user information
- Submit bookings
- Log results and send notifications
Set up a cron job to run the bot automatically every Monday at 12:01 AM:
./setup_cron.shThis script will:
- Configure a cron job with the specified schedule
- Set up logging to
cron.log - Show existing cron jobs
Default schedule: Every Monday at 12:01 AM Vietnam time
To customize the schedule, edit the cron expression when prompted:
- Format:
minute hour day month weekday - Example:
1 0 * * 1= Monday at 00:01 - Example:
0 20 * * 0= Sunday at 20:00 (8 PM)
Alternatively, set up cron manually:
crontab -eAdd this line:
1 0 * * 1 cd /home/user/pilatesbot && /usr/bin/python3 pilates_bot.py >> /home/user/pilatesbot/cron.log 2>&1
The bot creates detailed logs in two locations:
- pilates_bot.log: Main application log with timestamps
- cron.log: Output from cron job executions
View logs:
tail -f pilates_bot.log
tail -f cron.logThe Acuity Scheduling website structure may have changed. You can:
- Run with
headless: falseinconfig.yamlto watch the browser - Check the logs for specific error messages
- Take screenshots (automatically saved on errors)
- Update the CSS selectors in
pilates_bot.pyif needed
If running multiple times, the bot will attempt to book even if sessions are already reserved. Check your Acuity account to avoid double bookings.
Verify the cron job is set up:
crontab -lCheck cron is running:
sudo service cron statusCheck logs for errors:
tail -f cron.log- Verify credentials in
.env(bot token and chat ID) - Check
ENABLE_NOTIFICATIONS=true - Ensure you've sent a message to your bot (click "Start" button)
- Test with:
python3 test_telegram.py - Check logs for error messages:
tail pilates_bot.log
- Calculate Target Dates: Determines which Monday, Thursday, and Saturday to book (1 week ahead)
- Browser Automation: Uses Playwright to control a Chromium browser
- Navigation: Goes to Acuity Scheduling booking page
- Class Selection: Finds and clicks "Midday Flow" appointment type
- Date & Time: Selects the target date and 3:40 PM time slot
- Form Filling: Enters name, phone, email
- Submission: Submits the booking and waits for confirmation
- Alternative Handling: If preferred time unavailable, finds alternatives and notifies
- Notifications: Sends Telegram messages for success, alternatives, or errors
- Logging: Records all actions and outcomes
- Runs: Every Monday at 12:01 AM Vietnam time
- Books For: Next week's Mon/Thu/Sat sessions
- Advance Booking: 1 week ahead (configurable)
- Priority: 3:40 PM time slot
- Fallback: Same day, different time (within 2 hours)
- Confirmation: Required for alternative sessions (configurable)
Edit config.yaml:
session:
days:
- "Monday"
- "Wednesday" # Changed from Thursday
- "Saturday"Edit config.yaml:
session:
time: "4:00 PM" # Changed from 3:40 PMRun ./setup_cron.sh and enter a new cron expression, or edit crontab manually.
Edit config.yaml:
browser:
headless: true # false = see browser window
timeout: 30000 # 30 seconds- Never commit your
.envfile with real credentials - Store sensitive information only in
.env(already in.gitignore) - Review code before running on production systems
- Acuity Scheduling may block automated requests - use responsibly
If bot runs on Monday, January 15, 2026 at 12:01 AM, it will book:
- Monday, January 22, 2026 at 3:40 PM
- Thursday, January 25, 2026 at 3:40 PM
- Saturday, January 27, 2026 at 3:40 PM
Next run on Monday, January 22, 2026 at 12:01 AM will book:
- Monday, January 29, 2026 at 3:40 PM
- Thursday, February 1, 2026 at 3:40 PM
- Saturday, February 3, 2026 at 3:40 PM
For issues or questions:
- Check the logs first (
pilates_bot.log) - Review the configuration (
config.yaml) - Test manual execution:
python3 pilates_bot.py - Verify cron setup:
crontab -l
Personal use project. Modify as needed.
Built with β€οΈ for seamless Pilates session booking