Add NYTimes recipe extraction from __NEXT_DATA__ JSON tag

- Add Roux.NYTimes module with:
  - extractNextData: finds <script id="__NEXT_DATA__"> tag in HTML
    and parses its JSON content via aeson
  - parseNYTRecipe: maps NYTimes recipe JSON structure into a
    typed intermediate representation (NYTRecipe, NYTIngredientGroup,
    NYTIngredientItem, NYTStepGroup, NYTStepItem)
- Supports all NYTimes Cooking data: title, URL, total time, yield,
  topnote, ingredient groups (with section names), step groups
- Add aeson to dependencies
- Add 4 tests: extraction + parsing for both fried-rice and
  carrot-risotto example HTML files
- Wire NYTimesSpec into test runner
This commit is contained in:
2026-05-19 15:51:37 -04:00
parent 262faca90e
commit 21a4cea083
7 changed files with 443 additions and 4 deletions
+1
View File
@@ -28,6 +28,7 @@ ghc-options:
dependencies:
- base >= 4.7 && < 5
- aeson
- blaze-html
- blaze-markup
- bytestring