A lightweight HTTP proxy and Google Apps Script that scrapes the ACBL tournament calendar and populates a Google Sheet with upcoming bridge tournaments.
An Express server deployed on Google Cloud Run that fetches URLs on behalf of Google Apps Script (which cannot directly access ACBL's tournament API due to CORS/access restrictions).
- Endpoint:
GET /fetch?url=<encoded-url> - Authenticated via
x-proxy-secretrequest header ortokenquery parameter - Secret configured via
PROXY_SECRETenvironment variable in Cloud Run
Runs nightly via a time-based trigger. Fetches ACBL tournament data for all 25 districts and two calendar years, deduplicates entries, and writes upcoming events to the Upcoming sheet. Also syncs events to per-district Google Calendars.
Key functions:
refreshCalendar()— main entry point, fetches and writes tournament datasyncDistrictCalendarsRange(start, end)— syncs a range of district calendarssyncAllChunksSequentially()— syncs all 25 districts with pauses between chunks
- Deploy to Google Cloud Run (us-west1 for free tier)
- Set environment variable
PROXY_SECRETto a long random string
- Install clasp:
npm install -g @google/clasp - Enable the Apps Script API at script.google.com/home/usersettings
- Log in:
clasp login - Push changes:
cd appsscript && clasp push
In the Apps Script project, set a Script Property PROXY_SECRET matching the Cloud Run value:
- Apps Script editor → Project Settings (gear) → Script Properties
In the Apps Script editor, set a time-based trigger for refreshCalendar to run once per day.
- Proxy is deployed under
bridge-craftwork@gmail.comGoogle Cloud account - Cloud Run service:
acbl-proxyinus-west1