Updated ReadMe with information around an error that occurs where it's unable to scrape all the options.

This commit is contained in:
2026-02-24 11:28:19 -08:00
parent 34b54867a0
commit a5cb6fa7fa

View File

@@ -156,4 +156,53 @@ Signs that an entry has this problem:
The data lives in a JSON file, so be careful with quotation marks inside descriptions. Use a **curly/smart right double-quote** (`"`, U+201D) for inch marks (e.g. `7" pizza`) rather than a straight ASCII `"`, which would break the JSON string. Em dashes (``) and curly apostrophes (`'`) from the source website copy fine as-is.
**Critical: JSON structural quotes must be straight ASCII double quotes.** Some editors and AI tools auto-correct straight `"` to curly `"` / `"` (U+201C / U+201D). If curly quotes end up wrapping property names or values (e.g. `"name"` instead of `"name"`), the JSON file will fail to parse and no restaurants will appear in the app. Always verify that the structural quotes in the data use the straight ASCII `"` character (U+0022).
**Critical: JSON structural quotes must be straight ASCII double quotes.** Some editors and AI tools auto-correct straight `"` to curly `"` / `"` (U+201C / U+201D). If curly quotes end up wrapping property names or values (e.g. `"name"` instead of `"name"`), the JSON file will fail to parse and no restaurants will appear in the app. Always verify that the structural quotes in the data use the straight ASCII `"` character (U+0022).
---
### Incomplete Course Data (Missing or Too Few Menu Items)
#### Why It Happens
The Inlander Restaurant Week website is **JavaScript-rendered** — the actual menu content is loaded dynamically after the page shell is delivered. Automated tools (AI assistants, `curl`, simple web fetchers) only receive the bare HTML shell and never see the menu items. This causes courses to be entered with 0 or 1 item instead of the expected 3.
Signs a restaurant has this problem:
- A course array has **0 items** — the key exists but the array is empty (`[]`)
- A course array has **1 item** — only one option was captured instead of all three
- A course array has **2 items** — one option was missed
#### How to Find Affected Restaurants
Run the following Python script against the JSON file to identify any restaurant where a course does not have exactly 3 items:
```python
import json
with open('2026-restaurants.json', encoding='utf-8') as f:
restaurants = json.load(f)
for r in restaurants:
name = r.get('name', 'Unknown')
courses = r.get('menu', {}).get('courses', {})
issues = []
for course_name, items in courses.items():
if len(items) != 3:
issues.append(f"{course_name}: {len(items)} item(s)")
if issues:
print(f"{name}: {', '.join(issues)}")
```
Any restaurant printed by this script needs to be manually verified and corrected.
#### How to Manually Fix Incomplete Entries
1. Open the restaurant's IRW page in a **browser** (the `url` field in the JSON has the direct link, e.g. `https://inlanderrestaurantweek.com/project/flyinggoat/`).
2. Let the page fully load — the menu content is rendered by JavaScript and will not appear until the page has finished loading.
3. For each course, confirm there are 3 options and copy all dish names and descriptions.
4. Update the corresponding entry in `YYYY-restaurants.json`, adding the missing dish objects to the course array. Each dish follows this format:
```json
{ "name": "Dish Name", "desc": "Full description here GFA" }
```
5. Re-run the Python script above to confirm no courses are still flagged.
> **Note:** Some restaurants may genuinely offer fewer than 3 options for a course. If the live IRW page confirms only 1 or 2 choices are available, that count is correct and the entry does not need further changes.