Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/samgutentag/sbburgerweek/llms.txt

Use this file to discover all available pages before exploring further.

The hours feature enriches the map with real-time context: open/closed badges appear next to each restaurant in the sidebar, today’s hours show up inside the popup, and time-of-day filter buttons — Open Now, Lunch, and Dinner — let visitors narrow the list to places that are actually serving right now. Enabling this feature requires a Google Cloud project with the Places API turned on, two short Python scripts, and a daily GitHub Actions workflow.

How it works

The pipeline runs in two phases: One-time setup resolves your Google Maps links to stable Place IDs that don’t change even if a business moves or is renamed:
  1. fetch-place-ids.py reads each restaurant’s name, mapUrl, lat, and lng from data-2026.js. For each restaurant it calls the Find Place from Text API (using the restaurant name and coordinates as a location bias hint) to retrieve a ChIJ... Place ID. If that API call fails, it falls back to following the mapUrl redirect and extracting the Place ID from the expanded URL. Results are written to place-ids.json — a mapping of restaurant name → Place ID.
  2. You commit place-ids.json to the repo. This file is an input to the daily workflow and rarely needs to be regenerated.
Daily refresh fetches current hours for each Place ID:
  1. fetch-hours.py reads place-ids.json, calls the Places Details API (fields=opening_hours) for each restaurant that has a valid Place ID, and writes hours.json with opening periods and pre-computed lunch/dinner flags.
  2. A GitHub Actions workflow (.github/workflows/fetch-hours.yml) runs on a cron schedule during the event window, executes fetch-hours.py with your API key secret, and auto-commits hours.json if anything changed.
At runtime the app fetches hours.json and uses it to render open/closed badges and populate the time-of-day filters. If the file is absent or fails to load, those UI elements are silently hidden — no errors, no broken layout.

One-time setup

1

Create a Google Cloud project and enable the Places API

Go to console.cloud.google.com, create a new project (e.g. “SB Burger Week Map”), then navigate to APIs & Services → Library, search for Places API, and click Enable.
2

Create and restrict an API key

In APIs & Services → Credentials, click Create Credentials → API Key. Then click Edit on the new key, select Restrict key under API restrictions, and choose Places API only. Copy the key — you’ll need it in the next two steps.
3

Add the key as a GitHub repo secret

In your repo, go to Settings → Secrets and variables → Actions → New repository secret. Name it GOOGLE_PLACES_API_KEY and paste the key as the value. The daily workflow reads this secret automatically.
4

Run fetch-place-ids.py

From the repo root:
GOOGLE_PLACES_API_KEY=your_key python3 fetch-place-ids.py
The script reads name, mapUrl, lat, and lng from data-2026.js for every restaurant. For each one it first calls the Find Place from Text API (biased to the restaurant’s coordinates) to retrieve a ChIJ... Place ID. If that fails, it falls back to following the mapUrl redirect and extracting the Place ID from the expanded URL. Results are written to place-ids.json. Spot-check a few entries to confirm they resolved correctly — existing entries from a previous run are reused (the script does incremental updates).
5

Run fetch-hours.py

GOOGLE_PLACES_API_KEY=your_key python3 fetch-hours.py
The script reads place-ids.json and calls the Places Details API for each restaurant that has a valid Place ID. It parses the opening_hours.periods array returned by Google, normalises it into a simplified format (see hours.json format below), derives lunch and dinner boolean flags, and writes hours.json. Restaurants with no Place ID or no hours data get a null entry.
6

Commit place-ids.json and hours.json

git add place-ids.json hours.json
git commit -m "Add Place IDs and initial hours data"
git push
place-ids.json is a stable reference file — you only need to regenerate it if restaurants are added or removed. hours.json is refreshed daily by the workflow.
7

Uncomment the schedule block in fetch-hours.yml

Edit .github/workflows/fetch-hours.yml and uncomment the schedule: block, adjusting the cron expression to cover your event window:
schedule:
  # Daily at 6am PT (13:00 UTC) — adjust date range for next event
  - cron: "0 13 17-26 2 *"   # Feb 17–26 (2 days before through 1 day after)
Commit and push. The workflow will now run daily, fetch fresh hours, and auto-commit hours.json whenever the data changes.
You can also run fetch-hours.py locally at any time and commit the updated hours.json manually — no GitHub Action required. This is useful for testing or for a quick refresh outside the scheduled window.

hours.json format

The top-level object has a metadata key (_updated) followed by one key per restaurant. Each restaurant entry contains:
  • periods — an array of {day, open, close} objects. day follows Google’s convention: 0 = Sunday, 1 = Monday, …, 6 = Saturday. open and close are 24-hour strings ("HHMM").
  • lunchtrue if any period includes time before 15:00.
  • dinnertrue if any period includes time after 17:00.
  • null — if no Place ID or no hours data was available for that restaurant.
{
  "_updated": "2026-02-25T14:11:47Z",
  "Arnoldi's": {
    "periods": [
      { "day": 0, "open": "1100", "close": "2100" },
      { "day": 1, "open": "1600", "close": "2100" },
      { "day": 2, "open": "1600", "close": "2100" },
      { "day": 3, "open": "1600", "close": "2100" },
      { "day": 4, "open": "1600", "close": "2100" },
      { "day": 5, "open": "1600", "close": "2100" },
      { "day": 6, "open": "1600", "close": "2100" }
    ],
    "lunch": true,
    "dinner": true
  },
  "Caya": {
    "periods": [
      { "day": 0, "open": "0800", "close": "2100" },
      { "day": 1, "open": "0700", "close": "2100" },
      { "day": 2, "open": "0700", "close": "2100" },
      { "day": 3, "open": "0700", "close": "2100" },
      { "day": 4, "open": "0700", "close": "2100" },
      { "day": 5, "open": "0700", "close": "2100" },
      { "day": 6, "open": "0800", "close": "2100" }
    ],
    "lunch": true,
    "dinner": true
  },
  "Corner Tap": null
}
The lunch and dinner flags are pre-computed by fetch-hours.py so the app can evaluate the Lunch and Dinner filter buttons without looping over every period at runtime.

Graceful degradation

If hours.json is missing from the repo, fails to load at runtime (e.g. network error), or contains a null entry for a specific restaurant, the app handles it silently:
  • The Open Now, Lunch, and Dinner filter buttons do not appear.
  • No open/closed badge is shown for restaurants without hours data.
  • All other map features — search, area filters, dietary filters, directions, popups — continue to work normally.
This means you can deploy and use the map at any point without setting up the hours feature. Enable it whenever you’re ready.
The Google Places API free tier includes $200/month in credit, which covers approximately 6,600 Place Details requests at standard pricing. A daily workflow fetching hours for ~50 restaurants uses about 50 requests/day — well within the free tier for the duration of a week-long event. However, running fetch-place-ids.py for the first time also consumes Find Place requests (one per restaurant). Keep this in mind if your event has a significantly larger restaurant count.

Build docs developers (and LLMs) love