Skip to content

Today's lap swim schedule at Baltimore Ys in the terminal

License

Notifications You must be signed in to change notification settings

brianzelip/lapswim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lapswim

GitHub package.json version

Today's lap swim schedule at Baltimore's Waverly and Towson Ys in the terminal.

screenshot of lapswim cli

Schedules are scraped with Playwright, logged to stdout, and cached in a local json file for the day. The app is ran automatically by launchd on login and every 5 minutes.

Assumptions

  • macOS
  • jq installed via Homebrew at /opt/homebrew/bin/jq
  • Node.js installed via nvm at ~/.nvm
  • lapswim installed at ~/Code

Usage

  1. Clone lapswim
  2. Install dependencies
npm i
  1. Copy the sample plist file to your user agent directory and rename it
cp ./src/local.lapswim.plist.sample ~/Library/LaunchAgents/local.lapswim.plist
  1. Edit the Program and StandardErrorPath key values in ~/Library/LaunchAgents/local.lapswim.plist so the paths correspond to your machine
  2. Load the plist file with launchd
launchctl load ~/Library/LaunchAgents/local.lapswim.plist
  1. Set an alias in your terminal config file
# .zshrc, .bashrc, etc
alias swim='node ~/Code/lapswim/src/lapswim.mjs'
  1. Open a new terminal and run the swim alias to get today's lap swim times!
swim

> Saturday, December 2
>
> Waverly
> -------
> 7:00am-8:15am (3 lanes)
> 8:15am-12:30pm (1 lane)
> 12:30pm-6:30pm (3 lanes)
>
> Towson
> ------
> 7:00am-8:30am (6 lanes)
> 8:30am-12:00pm (4 lanes)
> 12:00pm-6:45pm (4 lanes)
>
> https://ymaryland.org/locations/weinbergy/weinbergschedules
> https://ymaryland.org/locations/orokaway/orokawaschedules

Resources

Contributing

Open a PR!

Author

Brian Zelip, https://zelip.me

License

GPLv3