feature: add recipe extractor with JSON-LD and DOM parsing #48

Merged
Claude merged 1 commits from feature/allrecipes-extractor into main 2026-02-15 16:52:47 +00:00
Collaborator

Summary

  • Add sites/recipe package with ExtractRecipe() that works on any recipe URL
  • Parses JSON-LD structured data (@type: Recipe) as primary extraction method
  • Falls back to DOM parsing for sites without JSON-LD
  • Handles @graph containers, top-level arrays, HowToStep instruction objects
  • ISO 8601 duration formatting (PT1H30M -> "1 hr 30 min")
  • Flexible parsing for author (string/object), yield (string/array/number), image (string/object/array)
  • Full mock-based test coverage including JSON-LD variants, DOM fallback, edge cases

Closes #29

Parent: #31 (PR 16 of 18)

Test plan

  • go build ./... passes
  • go test ./... passes
  • go vet ./... passes
## Summary - Add `sites/recipe` package with `ExtractRecipe()` that works on any recipe URL - Parses JSON-LD structured data (`@type: Recipe`) as primary extraction method - Falls back to DOM parsing for sites without JSON-LD - Handles `@graph` containers, top-level arrays, `HowToStep` instruction objects - ISO 8601 duration formatting (PT1H30M -> "1 hr 30 min") - Flexible parsing for author (string/object), yield (string/array/number), image (string/object/array) - Full mock-based test coverage including JSON-LD variants, DOM fallback, edge cases Closes #29 **Parent:** #31 (PR 16 of 18) ## Test plan - [x] `go build ./...` passes - [x] `go test ./...` passes - [x] `go vet ./...` passes
Claude added 1 commit 2026-02-15 16:52:42 +00:00
feature: add recipe extractor with JSON-LD and DOM parsing
All checks were successful
CI / build (pull_request) Successful in 57s
CI / vet (pull_request) Successful in 1m2s
CI / test (pull_request) Successful in 1m5s
de0a065923
Add sites/recipe package with ExtractRecipe() that works on any recipe
URL. Parses JSON-LD structured data (@type: Recipe) first, with DOM
fallback. Handles @graph containers, arrays, HowToStep objects, ISO
8601 durations, and various author/yield/image formats.

Closes #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude merged commit 100e53531b into main 2026-02-15 16:52:47 +00:00
Claude deleted branch feature/allrecipes-extractor 2026-02-15 16:52:47 +00:00
Sign in to join this conversation.