- Go 100%
| internal | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| PLAN.md | ||
| README.md | ||
EDBA calendar generator
A small Go CLI that reads the public Exeter District Basketball Association schedule, snapshots it in SQLite, reports changes between snapshots, and exports team-centric iCalendar files.
The CLI reads the site's public Firestore backend directly. It does not scrape the React page and does not need a browser.
Build
Requires Go 1.25 or newer.
go build -o edba ./cmd/edba
The default database is edba.db. Every command accepts --db to use another
path.
First import
The first import needs permission to create canonical team identities:
./edba import --accept-new-teams
Later imports do not need that flag:
./edba import
The active season is discovered automatically. Use --season "2026 - 2027"
to import a specific season.
Export a calendar
At least one --team is required. The flag can be repeated, and the output is
the union of those teams' games:
./edba export \
--team "Tiverton Titans" \
--team "Tiverton Titans II" \
--out titans.ics \
--html titans.html
Use --out for iCalendar, --html for a standalone schedule page, or both.
If neither is set, iCalendar is written to stdout.
Each event is shown from the selected team's perspective:
Tiverton Titans Away vs. Crediton Chargers
Tiverton Titans II Home vs. Bridgwater Blackhawks
The HTML export groups fixtures by month and marks Home / Away for the selected teams.
Use repeatable --league flags for additional narrowing. Completed games are
excluded unless --include-completed is supplied.
Calendar event UIDs are based on season, league, canonical home team, and canonical away team. A fixture that changes date or venue therefore updates the existing calendar event instead of creating another one.
Compare imports
By default, diff compares the latest two imports:
./edba diff \
--team "Tiverton Titans" \
--team "Tiverton Titans II"
--team and --league are repeatable and have the same meaning as in
export. Filtering happens before changes are classified, so unrelated
fixtures do not trigger the result.
Select snapshots explicitly with --from ID --to ID, or create a static HTML
report:
./edba diff --team "Tiverton Titans" --html changes.html
Exit codes are:
0: no matching changes1: command failed2: matching games changed
Team name changes
The Firestore team document ID is recorded as a source alias, while calendar UIDs use a separate canonical team identity. This keeps events stable if a team is renamed or recreated.
If a later import finds an unknown source team, it records it as pending and stops before creating a partial snapshot:
./edba teams list
./edba teams add-alias --source NEW_FIRESTORE_ID --team "Existing Team"
./edba import
If it is genuinely a new team, review it and rerun the import with
--accept-new-teams.
Export nicknames
Set a shorter or preferred name for iCalendar and HTML exports:
./edba teams set-nickname --team "Tiverton Titans" --name "Titans"
./edba teams set-nickname --team "Tiverton Titans II" --name "Titans II"
Nicknames can also be used in subsequent --team filters. They only affect
displayed export names: canonical identities, imported source data, diffs, and
stable calendar UIDs are unchanged.
List configured nicknames with ./edba teams list, or remove one with:
./edba teams set-nickname --team "Titans" --clear
Automation
A cron-style job can import, inspect a filtered diff, and export:
./edba import
./edba diff --team "Tiverton Titans" --team "Tiverton Titans II"
./edba export --team "Tiverton Titans" --team "Tiverton Titans II" --out titans.ics --html titans.html
The Firestore project and public web API key are configurable through
EDBA_FIRESTORE_PROJECT, EDBA_FIRESTORE_API_KEY, or the corresponding
import flags.