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. This will cancel an existing reservation when an earlier bus becomes available, and it will book that earlier one instead.
Books buses for the next 2 weeks based on your configuration:
python reserve_bus_seats_bushub.py
# or
python reserve_bus_seats_bushub.py continuousContinuously monitors for PM bus availability and books immediately when available:
python reserve_bus_seats_bushub.py home-soonYou can also specify a custom check interval (in seconds):
python reserve_bus_seats_bushub.py home-soon --check-interval 60login_details.txt: Contains your username and password in the formatusername,passwordconfig.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.yamlwith 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 availability of a bus earlier than any existing reservation
- Books immediately when a bus with available seats is found, including the cancellation of an existing but later bus reservation
- 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