Bot to monitor for southbound permit spaces on the John Muir Trail
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
environment.yml
hackjohn.py
requirements.txt

README.md

Bot to monitor for southbound permit spaces on the John Muir Trail

This repository contains a Python script for monitoring Yosemite's Donohue Exit Quota and Trailhead Space Available online table. Vacancies in this table indicate the availability of a southbound John Muir Trail permit, available for immediate reservation by calling the Yosemite Wilderness Permit Reservations at 1-209-372-0740. This strategy enables securing a soutbound JMT permit after the lottery drawing for a given date.

Learn more about using hackjohn and its history of success in the blog post titled Introducing the hackjohn bot for southbound John Muir Trail permits.

Usage

Modify hackjohn.py with the parameters of your permit search. To receive Telegram notfications, set your token for the MiddleManBot. Then simply run the hackjohn Python script in the hackjohn conda environment (described below) with:

python hackjohn.py

The script with print the table of available spaces via stdout.

Environment

The environment can be installed using either Virtual Environments or Conda.

Virtual Environment

To insall a virtual environment, run the following:

# Create a virtual environment in the env directory
python3 -m venv env

# Activate the virtual environment
source env/bin/activate

# Install the required dependencies into the virtual env
pip install --requirement requirements.txt

Conda

The conda environment for this repository is specified in environment.yml. Install this environment with:

conda env create --file environment.yml

Then use conda activate hackjohn and conda deactivate to activate or deactivate the environment.

Automation

You can automate the running of hackjohn.py at scheduled times every day. According to the Yosemite permit office, the trailhead quotas are often updated around 11 AM Pacific Time.

I used cron, which despite its awful interface got the job done. Therefore, I added the following lines to my crontab configuration (replacing ABOSOLUTE_REPO_PATH with the absolute path to the directory containing hackjohn.py):

# hackjohn bot scheduling (configured for a system on Eastern Time)
0 13 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
44 13 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
59 13 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
14 14 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
30 14 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
40 14 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
00 15 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
19 15 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log
00 19 * * * ABOSOLUTE_REPO_PATH/hackjohn.py >> ABOSOLUTE_REPO_PATH/hackjohn.log

Run crontab -e to edit your cron configuration.