I built a tool to scrape the latest schedule from Title’s website and output CSV data ready for import into Google Calendar.
Title Boxing Club is a fitness gym that holds trainer-led classes daily. On their website, each location has its own “homepage.” You can find the schedule for the next 11–12 days on this page. This is the only way to access the schedule online. There is no iCal or alternative transportable version. This makes it difficult to integrate their schedule with your own personal calendar.
I decided to create a command line utility that solves this problem.
If you feed this command a location’s homepage URL (for example: https://titleboxingclub.com/chicago-south-loop-il/), it will pull the available schedule and automatically create a CSV file.
The output can be saved to a file and imported into Google Calendar.
You will need to have Node.js installed already. Once it is installed, clone the repository and install dependencies.
> git clone [https://github.com/travishorn/title-schedule-scraper.git]( ) > npm install
Enter your zip or city and state in the search bar
Click your location
Copy the URL
Once you have the URL, simply run…
> node index [options] <url>
-V, --versionOutput the version number
-c, --class <name>Only include the specified class type (ex: Boxing)
-d, --duration <minutes>Only include the classes that last the specified number of minutes (ex: 60)
-t, --trainer <name>Only include the specified trainer (ex: Jordan)
-h, --helpOutput usage information
> node index -c Boxing -d 60 -t Jordan https://titleboxingclub.com/chicago-south-loop-il/
This command will output CSV data to the terminal. You can pipe this data to a file like so:
> node index https://titleboxingclub.com/chicago-south-loop-il/ > title-schedule.csv
Once you have the CSV, you can import it into Google Calendar if you wish.
The end result
Since Title understandably only supplies the schedule for the next week or so, you’ll need to rerun the process periodically.
How does it work?
You can see the full source code on GitHub. travishorn/title-schedule-scraper Scrapes the latest schedule from Title's website and outputs a CSV file ready for import into Google Calendar. …github.com
Each time the command is run…
CLI options are parsed by Commander
The URL is requested by Axios
Cheerio parses the returned HTML
Details of each class are loaded into an array of objects
If any options are specified (ex: Only kickboxing), the array is
filter()ed for each one.
csv-writer outputs data in CSV format