From ee92a0963ae2bd791255587a3f33ef39b9e8aeb1 Mon Sep 17 00:00:00 2001
From: Joey <7505194+jknndy@users.noreply.github.com>
Date: Thu, 17 Oct 2024 18:39:01 -0400
Subject: [PATCH 1/2] rename
---
tests/test_data/tasty.co/{tasty.json => tasty_1.json} | 0
tests/test_data/tasty.co/{tasty.testhtml => tasty_1.testhtml} | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename tests/test_data/tasty.co/{tasty.json => tasty_1.json} (100%)
rename tests/test_data/tasty.co/{tasty.testhtml => tasty_1.testhtml} (100%)
diff --git a/tests/test_data/tasty.co/tasty.json b/tests/test_data/tasty.co/tasty_1.json
similarity index 100%
rename from tests/test_data/tasty.co/tasty.json
rename to tests/test_data/tasty.co/tasty_1.json
diff --git a/tests/test_data/tasty.co/tasty.testhtml b/tests/test_data/tasty.co/tasty_1.testhtml
similarity index 100%
rename from tests/test_data/tasty.co/tasty.testhtml
rename to tests/test_data/tasty.co/tasty_1.testhtml
From da8bdf87e7ade802043fa2609b9da4be27d467ec Mon Sep 17 00:00:00 2001
From: Joey <7505194+jknndy@users.noreply.github.com>
Date: Thu, 17 Oct 2024 18:40:08 -0400
Subject: [PATCH 2/2] groupings
---
recipe_scrapers/tasty.py | 6 +
tests/test_data/tasty.co/tasty_2.json | 112 ++++++++++++
tests/test_data/tasty.co/tasty_2.testhtml | 199 ++++++++++++++++++++++
3 files changed, 317 insertions(+)
create mode 100644 tests/test_data/tasty.co/tasty_2.json
create mode 100644 tests/test_data/tasty.co/tasty_2.testhtml
diff --git a/recipe_scrapers/tasty.py b/recipe_scrapers/tasty.py
index 040f214ad..c8eba1ddf 100644
--- a/recipe_scrapers/tasty.py
+++ b/recipe_scrapers/tasty.py
@@ -1,7 +1,13 @@
from ._abstract import AbstractScraper
+from ._grouping_utils import group_ingredients
class Tasty(AbstractScraper):
@classmethod
def host(cls):
return "tasty.co"
+
+ def ingredient_groups(self):
+ return group_ingredients(
+ self.ingredients(), self.soup, ".ingredient-section-name", ".ingredient"
+ )
diff --git a/tests/test_data/tasty.co/tasty_2.json b/tests/test_data/tasty.co/tasty_2.json
new file mode 100644
index 000000000..7bc03b76b
--- /dev/null
+++ b/tests/test_data/tasty.co/tasty_2.json
@@ -0,0 +1,112 @@
+{
+ "author": "Scott Loitsch",
+ "canonical_url": "https://tasty.co/recipe/homemade-cinnamon-rolls",
+ "site_name": "tasty.co",
+ "host": "tasty.co",
+ "language": "en",
+ "title": "Homemade Cinnamon Rolls Recipe by Tasty",
+ "ingredients": [
+ "½ cup unsalted butter, melted",
+ "2 cups whole milk, warm to the touch",
+ "½ cup granulated sugar",
+ "2 ¼ teaspoons active dry yeast",
+ "5 cups flour, divided",
+ "1 teaspoon baking powder",
+ "2 teaspoons salt",
+ "¾ cup butter, softened",
+ "¾ cup light brown sugar",
+ "2 tablespoons ground cinnamon",
+ "4 oz cream cheese, softened",
+ "2 tablespoons butter, melted",
+ "2 tablespoons whole milk",
+ "1 teaspoon vanilla extract",
+ "1 cup powdered sugar"
+ ],
+ "ingredient_groups": [
+ {
+ "ingredients": [
+ "½ cup unsalted butter, melted",
+ "2 cups whole milk, warm to the touch",
+ "½ cup granulated sugar",
+ "2 ¼ teaspoons active dry yeast",
+ "5 cups flour, divided",
+ "1 teaspoon baking powder",
+ "2 teaspoons salt"
+ ],
+ "purpose": "Dough"
+ },
+ {
+ "ingredients": [
+ "¾ cup butter, softened",
+ "¾ cup light brown sugar",
+ "2 tablespoons ground cinnamon"
+ ],
+ "purpose": "Filling"
+ },
+ {
+ "ingredients": [
+ "4 oz cream cheese, softened",
+ "2 tablespoons butter, melted",
+ "2 tablespoons whole milk",
+ "1 teaspoon vanilla extract",
+ "1 cup powdered sugar"
+ ],
+ "purpose": "Frosting"
+ }
+ ],
+ "instructions_list": [
+ "Generously butter two disposable foil pie/cake pans.",
+ "In a large bowl, whisk together warm milk, melted butter, and granulated sugar. The mixture should be just warm, registering between 100-110˚F (37-43˚C). If it is hotter, allow to cool slightly.",
+ "Sprinkle the yeast evenly over the warm mixture and let set for 1 minute.",
+ "Add 4 cups (500g) of all-purpose flour to the milk mixture and mix with a wooden spoon until just combined.",
+ "Cover the bowl with a towel or plastic wrap and set in a warm place to rise for 1 hour.",
+ "After 1 hour, the dough should have nearly doubled in size.",
+ "Remove the towel and add an additional ¾ cup (95g) of flour, the baking powder, and salt. Stir well, then turn out onto a well-floured surface.",
+ "Knead the dough lightly, adding additional flour as necessary, until the dough just loses its stickiness and does not stick to the surface.",
+ "Roll the dough out into a large rectangle, about ½-inch (1 cm) thick. Fix corners to make sure they are sharp and even.",
+ "Spread the softened butter evenly over the dough.",
+ "Sprinkle evenly with brown sugar and a generous sprinkling of cinnamon.",
+ "Press the mixture into the butter.",
+ "Roll up the dough, forming a log, and pinch the seam closed. Place seam-side down. Trim off any unevenness on either end.",
+ "Cut the log in half, then divide each half into 7 evenly sized pieces. About 1½ inches (8cm) thick each.",
+ "Place 7 cinnamon rolls in each cake pan, one in the center, six around the sides. Cover with plastic wrap and place in a warm place to rise for 30 minutes.",
+ "Preheat oven to 350˚F (180˚C).",
+ "To prepare the frosting. In a medium-size mixing bowl, whisk together cream cheese, butter, whole milk, vanilla, and powdered sugar, until smooth.",
+ "Remove plastic wrap. Bake the cinnamon rolls in a preheated oven for 25-30 minutes, until golden brown.",
+ "While still warm, drizzle evenly with frosting.",
+ "Enjoy!"
+ ],
+ "category": "Desserts",
+ "yields": "14 servings",
+ "description": "There's nothing better than waking up to a fresh batch of ooey, gooey cinnamon rolls straight from the oven. This recipe starts with a soft, pillowy dough enriched with butter and milk. The dough is generously sprinkled with a mixture of butter, brown sugar, and cinnamon for a sweet and aromatic filling that will fill your kitchen as it bakes. Once out of the oven, these golden-brown beauties are crowned with a luscious cream cheese icing, adding a tanginess that balances the sweetness perfectly. Homemade cinnamon rolls are a nostalgic indulgence that brings joy to any breakfast or brunch table.",
+ "total_time": 151,
+ "cook_time": 30,
+ "prep_time": 30,
+ "cuisine": "Cuisine",
+ "ratings": 4.9,
+ "ratings_count": 19961,
+ "nutrients": {
+ "calories": "479 calories",
+ "fatContent": "22 grams",
+ "carbohydrateContent": "63 grams",
+ "sugarContent": "24 grams",
+ "proteinContent": "7 grams",
+ "fiberContent": "1 gram"
+ },
+ "image": "https://img.buzzfeed.com/video-api-prod/assets/9d589367531e4c12a4937e30e521c865/fbthumb.jpg?resize=1200:*",
+ "keywords": [
+ "bake sale",
+ "breakfast",
+ "cinnamon buns",
+ "cinnamon rolls",
+ "dessert",
+ "frosting",
+ "homemade",
+ "recipe",
+ "tasty",
+ "tasty_vegetarian",
+ "today food",
+ "video",
+ "yeast"
+ ]
+}
diff --git a/tests/test_data/tasty.co/tasty_2.testhtml b/tests/test_data/tasty.co/tasty_2.testhtml
new file mode 100644
index 000000000..d05db8cd1
--- /dev/null
+++ b/tests/test_data/tasty.co/tasty_2.testhtml
@@ -0,0 +1,199 @@
+
+
Homemade Cinnamon Rolls
Opens in a new windowOpens an external site in a new windowOpens an external site
There's nothing better than waking up to a fresh batch of ooey, gooey cinnamon rolls straight from the oven. This recipe starts with a soft, pillowy dough enriched with butter and milk. The dough is generously sprinkled with a mixture of butter, brown sugar, and cinnamon for a sweet and aromatic filling that will fill your kitchen as it bakes. Once out of the oven, these golden-brown beauties are crowned with a luscious cream cheese icing, adding a tanginess that balances the sweetness perfectly. Homemade cinnamon rolls are a nostalgic indulgence that brings joy to any breakfast or brunch table.
Generously butter two disposable foil pie/cake pans.
In a large bowl, whisk together warm milk, melted butter, and granulated sugar. The mixture should be just warm, registering between 100-110˚F (37-43˚C). If it is hotter, allow to cool slightly.
Sprinkle the yeast evenly over the warm mixture and let set for 1 minute.
Add 4 cups (500g) of all-purpose flour to the milk mixture and mix with a wooden spoon until just combined.
Cover the bowl with a towel or plastic wrap and set in a warm place to rise for 1 hour.
After 1 hour, the dough should have nearly doubled in size.
Remove the towel and add an additional ¾ cup (95g) of flour, the baking powder, and salt. Stir well, then turn out onto a well-floured surface.
Knead the dough lightly, adding additional flour as necessary, until the dough just loses its stickiness and does not stick to the surface.
Roll the dough out into a large rectangle, about ½-inch (1 cm) thick. Fix corners to make sure they are sharp and even.
Spread the softened butter evenly over the dough.
Sprinkle evenly with brown sugar and a generous sprinkling of cinnamon.
Press the mixture into the butter.
Roll up the dough, forming a log, and pinch the seam closed. Place seam-side down. Trim off any unevenness on either end.
Cut the log in half, then divide each half into 7 evenly sized pieces. About 1½ inches (8cm) thick each.
Place 7 cinnamon rolls in each cake pan, one in the center, six around the sides. Cover with plastic wrap and place in a warm place to rise for 30 minutes.
Preheat oven to 350˚F (180˚C).
To prepare the frosting. In a medium-size mixing bowl, whisk together cream cheese, butter, whole milk, vanilla, and powdered sugar, until smooth.
Remove plastic wrap. Bake the cinnamon rolls in a preheated oven for 25-30 minutes, until golden brown.
While still warm, drizzle evenly with frosting.
Enjoy!
Ready for a smarter way to find recipes? Use Botatouille, our AI-powered food genius in the Tasty app. Download here