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.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.
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:fetch-place-ids.pyreads each restaurant’sname,mapUrl,lat, andlngfromdata-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 aChIJ...Place ID. If that API call fails, it falls back to following themapUrlredirect and extracting the Place ID from the expanded URL. Results are written toplace-ids.json— a mapping of restaurant name → Place ID.- You commit
place-ids.jsonto the repo. This file is an input to the daily workflow and rarely needs to be regenerated.
fetch-hours.pyreadsplace-ids.json, calls the Places Details API (fields=opening_hours) for each restaurant that has a valid Place ID, and writeshours.jsonwith opening periods and pre-computedlunch/dinnerflags.- A GitHub Actions workflow (
.github/workflows/fetch-hours.yml) runs on a cron schedule during the event window, executesfetch-hours.pywith your API key secret, and auto-commitshours.jsonif anything changed.
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
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.
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.
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.Run fetch-place-ids.py
From the repo root: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).Run fetch-hours.py
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.Commit place-ids.json and hours.json
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.Uncomment the schedule block in fetch-hours.yml
Edit Commit and push. The workflow will now run daily, fetch fresh hours, and auto-commit
.github/workflows/fetch-hours.yml and uncomment the schedule: block, adjusting the cron expression to cover your event window:hours.json whenever the data changes.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.dayfollows Google’s convention:0= Sunday,1= Monday, …,6= Saturday.openandcloseare 24-hour strings ("HHMM").lunch—trueif any period includes time before 15:00.dinner—trueif any period includes time after 17:00.null— if no Place ID or no hours data was available for that restaurant.
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
Ifhours.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.