This script automates bus seat reservations for the Wellcome Genome Campus BusHub service.
- Continuous Mode: Books buses for the next 2 weeks (default behavior)
- Home-Soon Mode: Continuously monitors for PM bus availability and books as soon as it becomes available
Books buses for the next 2 weeks based on your configuration:
python reserve_bus_seats_bushub.py
# or
python reserve_bus_seats_bushub.py continuous
Continuously monitors for PM bus availability and books immediately when available:
python reserve_bus_seats_bushub.py home-soon
You can also specify a custom check interval (in seconds):
python reserve_bus_seats_bushub.py home-soon --check-interval 60
login_details.txt
: Contains your username and password in the formatusername,password
config.yaml
: Defines your bus routes for each day of the weekbushub_cookie.txt
: Contains your authentication cookie (automatically generated)
days:
Monday:
AM:
pickup: "Centennial Hotel - S"
dropoff: "Wellcome Genome Campus"
PM:
pickup: "Wellcome Genome Campus"
dropoff: "Brooklands Av - N (RQ)"
# ... repeat for other days
- Fetches the latest bus stop information from the API
- Updates
busroutes.yaml
with current route data - Checks existing reservations to avoid duplicates
- Books buses for the next 2 weeks (weekdays only)
- Monitors only the PM route for today
- Checks every 30 seconds (configurable) for bus availability
- Books immediately when a bus with available seats is found
- Stops when a reservation is successfully made or manually interrupted
- Python 3.6+
- Required packages:
requests
,yaml
,beautifulsoup4
Install dependencies:
pip install requests pyyaml beautifulsoup4