Skip to content

Commit

Permalink
bitsofcarey note improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jknndy committed Oct 2, 2024
1 parent b1d75e4 commit 0416afe
Show file tree
Hide file tree
Showing 4 changed files with 4,029 additions and 3 deletions.
17 changes: 15 additions & 2 deletions recipe_scrapers/bitsofcarey.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@ def ingredient_groups(self):

def equipment(self):
equipment_items = self.soup.select(
".wprm-recipe-equipment-container .wprm-recipe-equipment-item .wprm-recipe-equipment-name"
".wprm-recipe-equipment-container .wprm-recipe-equipment-item"
)
equipment_list = [item.get_text() for item in equipment_items]
equipment_list = []

for item in equipment_items:
name_element = item.select_one(".wprm-recipe-equipment-name")
note = item.select_one(".wprm-recipe-equipment-notes")

name = name_element.get_text(strip=True)

if note:
note_text = note.get_text(strip=True)
name = name.replace(note_text, "").strip()
name += f" (note: {note_text})"

equipment_list.append(name)

return get_equipment(equipment_list)
2 changes: 1 addition & 1 deletion tests/test_data/bitsofcarey.com/bitsofcarey_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"cook_time": 12,
"prep_time": 15,
"equipment": [
"airfryer optional"
"airfryer (note: optional)"
],
"nutrients": {
"servingSize": "1 serving",
Expand Down
112 changes: 112 additions & 0 deletions tests/test_data/bitsofcarey.com/bitsofcarey_3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"author": "Kayla Burton",
"canonical_url": "https://brokenovenbaking.com/black-velvet-cupcakes/",
"site_name": "Broken Oven Baking",
"host": "bitsofcarey.com",
"language": "en-US",
"title": "Black Velvet Cupcakes with Raspberry Filling",
"ingredients": [
"1 cup all-purpose flour (weighed in grams or spooned and leveled)",
"⅓ cup black cocoa powder (or regular cocoa powder)",
"½ teaspoon baking soda",
"¼ teaspoon salt",
"⅔ cup granulated sugar",
"⅓ cup vegetable oil",
"1 large egg (room temperature)",
"⅓ cup Lifeway Organic Plain Whole Milk Kefir (room temperature)",
"½ teaspoon white vinegar",
"¼ teaspoon black food coloring (optional, more/less depending on color intensity)",
"⅓ cup hot water",
"3 tablespoons raspberry preserves (optional, or other filling of choice)",
"1 cup unsalted butter (room temperature)",
"3 cups powdered sugar",
"½ cup black cocoa powder (or regular cocoa powder)",
"¼ cup heavy whipping cream (more/less depending on consistency)",
"1 tiny pinch salt (to taste)",
"sprinkles (optional)"
],
"ingredient_groups": [
{
"ingredients": [
"1 cup all-purpose flour (weighed in grams or spooned and leveled)",
"⅓ cup black cocoa powder (or regular cocoa powder)",
"½ teaspoon baking soda",
"¼ teaspoon salt",
"⅔ cup granulated sugar",
"⅓ cup vegetable oil",
"1 large egg (room temperature)",
"⅓ cup Lifeway Organic Plain Whole Milk Kefir (room temperature)",
"½ teaspoon white vinegar",
"¼ teaspoon black food coloring (optional, more/less depending on color intensity)",
"⅓ cup hot water",
"3 tablespoons raspberry preserves (optional, or other filling of choice)"
],
"purpose": "Black Velvet Cupcakes"
},
{
"ingredients": [
"1 cup unsalted butter (room temperature)",
"3 cups powdered sugar",
"½ cup black cocoa powder (or regular cocoa powder)",
"¼ cup heavy whipping cream (more/less depending on consistency)",
"1 tiny pinch salt (to taste)",
"sprinkles (optional)"
],
"purpose": "Black Buttercream Frosting"
}
],
"instructions_list": [
"Black Velvet Cupcakes",
"Preheat oven to 350°F and fill a cupcake pan with liners.",
"In a large bowl, whisk together the flour, cocoa powder, baking soda, and salt.",
"In a medium bowl, whisk together the sugar, vegetable oil, egg, kefir, vinegar, and food coloring.",
"Pour the wet ingredients into the dry ones and mix until a few flour streaks remain. Then, stir in the hot water until combined.",
"Pour the batter evenly throughout the cupcake liners (they should be about 1/2-2/3 full). Bake on the middle rack until a toothpick comes out clean (12-15 minutes).",
"Black Buttercream Frosting",
"In a medium/large bowl, cream together the softened butter, powdered sugar, black cocoa powder, heavy whipping cream, and salt until smooth.",
"Transfer the buttercream to a piping bag fitted with a large piping tip.",
"Assemble the Cupcakes",
"Cut the centers out of the cooled cupcakes (be careful not to cut all the way through the bottom). Save the cutouts. Fill the holes with raspberry preserves, and then place the cutout back on top.",
"Pipe frosting on top of the cupcakes and then decorate with sprinkles or any other decorations!"
],
"category": "Dessert",
"yields": "12 servings",
"description": "These black velvet cupcakes are made with black cocoa powder and filled with raspberry jam!",
"total_time": 37,
"cook_time": 12,
"prep_time": 25,
"cuisine": "American",
"ratings": 5.0,
"ratings_count": 3,
"equipment": [
"Mixing bowls",
"Measuring spoons",
"Scale/measuring cups",
"Whisk",
"Spatula",
"Cupcake pan (note: with liners)",
"Electric mixer (note: recommended for the frosting)",
"Piping bag and tip",
"Decorations (note: optional)"
],
"nutrients": {
"servingSize": "1 serving",
"calories": "441 kcal",
"fatContent": "25 g",
"saturatedFatContent": "13 g",
"unsaturatedFatContent": "10 g",
"transFatContent": "1 g",
"carbohydrateContent": "56 g",
"sugarContent": "43 g",
"proteinContent": "3 g",
"sodiumContent": "111 mg",
"fiberContent": "3 g",
"cholesterolContent": "63 mg"
},
"image": "https://brokenovenbaking.com/wp-content/uploads/2023/09/black-velvet-cupcakes-14.jpg",
"keywords": [
"black velvet cupcakes",
"chocolate raspberry cupcakes",
"Halloween cupcakes"
]
}
Loading

0 comments on commit 0416afe

Please sign in to comment.