Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredient grouping & equipment support for saltpepperskillet #1334

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions recipe_scrapers/saltpepperskillet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class SaltPepperSkillet(AbstractScraper):
Expand All @@ -8,3 +9,24 @@ def host(cls):

def author(self):
return self.schema.author().title()

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
Comment on lines +13 to +19
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we should probably consider making WPRM ingredient-group support available as a Mixin (or perhaps a few mixins with different variants based on the WordPress plugin(s) in use) -- these defaults seem to appear fairly often.


def equipment(self):
equipment_container = self.soup.find(
"div", class_="wprm-recipe-equipment-container"
)
if equipment_container:
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]
return None
Comment on lines +25 to +32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if equipment_container:
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]
return None
if not equipment_container:
return None
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]

...and maybe get_equipment? :)

53 changes: 0 additions & 53 deletions tests/test_data/saltpepperskillet.com/saltpepperskillet.json

This file was deleted.

981 changes: 0 additions & 981 deletions tests/test_data/saltpepperskillet.com/saltpepperskillet.testhtml

This file was deleted.

36 changes: 36 additions & 0 deletions tests/test_data/saltpepperskillet.com/saltpepperskillet_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"author": "Justin Mcchesney-Wachs",
"canonical_url": "https://saltpepperskillet.com/picanha/",
"site_name": "Salt Pepper Skillet",
"host": "saltpepperskillet.com",
"language": "en-US",
"title": "Smoked Picanha",
"ingredients": [
"1 whole picanha steak with fat cap on",
"kosher salt or coarse rock salt",
"2 tsp neutral oil"
],
"instructions_list": [
"Prep the picanha by trimming any silver skin from the bottom side. Use a sharp knife to score the fat cap in a 1/2-inch cross-hatch pattern. This will help render the fat. Drizzle lightly with oil and generously season all over with kosher salt. Allow to sit for at least 1 hour at room temperature, or ideally refrigerate overnight.",
"Preheat your smoker, to 250°-275°F (120°-135° C), setting up for indirect low and slow smoking. Add preferred wood chunks, chips, or pellets such as oak or hickory.",
"Cook - Place picanha on the cool side of the smoker with a remote probe thermometer inserted into the thickest part of the meat. Close the lid and cook until the internal temperature reaches 115°F (46° C), about 60-90 minutes.",
"Remove - Once at 115°F internal, remove picanha from the smoker and increase the grill's temperature to high heat for searing. Alternatively, heat a heavy skillet over high heat on the stove.",
"Sear the picanha for about 2 minutes per side, until a nice crust forms on the exterior and the internal temperature reaches 130°-135°F (54°-57° C) for medium-rare doneness.",
"Allow the steak to rest for 10 minutes before slicing against the grain. Sprinkle with a bit more salt before serving. Enjoy with chimichurri sauce or your favorite sauce and sides."
],
"category": "Main",
"yields": "6 servings",
"description": "Picanha or sirloin cap is one of the most satisfying and flavorful cuts of beef you can experience. You'll cook it to perfection in the smoker followed by a quick sear for a golden crust.",
"total_time": 80,
"cook_time": 75,
"prep_time": 5,
"cuisine": "Brazilian",
"ratings": 5.0,
"ratings_count": 3,
"image": "https://saltpepperskillet.com/wp-content/uploads/picanha-steak-with-chimichurri-overhead-horizontal.jpg",
"keywords": [
"flap steak",
"picanha",
"sirloin cap"
]
}
900 changes: 900 additions & 0 deletions tests/test_data/saltpepperskillet.com/saltpepperskillet_1.testhtml

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions tests/test_data/saltpepperskillet.com/saltpepperskillet_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"author": "Justin Mcchesney-Wachs",
"canonical_url": "https://saltpepperskillet.com/smoked-bread-pudding/",
"site_name": "Salt Pepper Skillet",
"host": "saltpepperskillet.com",
"language": "en-US",
"title": "Smoked Bread Pudding",
"ingredients": [
"1 lb brioche bread or croissants",
"8 large eggs",
"1 ½ cups heavy whipping cream",
"3 ½ cups whole milk",
"2 cups sugar",
"1/4 tsp kosher salt",
"1 teaspoon vanilla extract",
"½ cup raisins",
"3 tbsp bourbon for soaking the raisins ((can use the same bourbon for the sauce))",
"½ cup butter",
"¾ cup packed brown sugar",
"3 tablespoons bourbon ((drained from the raisins))",
"½ cup heavy cream",
"½ teaspoon ground cinnamon"
],
"ingredient_groups": [
{
"ingredients": [
"1 lb brioche bread or croissants",
"8 large eggs",
"1 ½ cups heavy whipping cream",
"3 ½ cups whole milk",
"2 cups sugar",
"1/4 tsp kosher salt",
"1 teaspoon vanilla extract",
"½ cup raisins",
"3 tbsp bourbon for soaking the raisins ((can use the same bourbon for the sauce))"
],
"purpose": null
},
{
"ingredients": [
"½ cup butter",
"¾ cup packed brown sugar",
"3 tablespoons bourbon ((drained from the raisins))",
"½ cup heavy cream",
"½ teaspoon ground cinnamon"
],
"purpose": "Bourbon Sauce (Optional)"
}
],
"instructions_list": [
"To make the bread pudding",
"Dry the Bread: Preheat your smoker to 225° F (107° F). Your oven can also be used for this step.",
"Slice the bread with a sharp serrated knife into 1” cubes.",
"Place the bread cubes into a 13x9\" disposable aluminum roasting pan. Place into the smoker or oven until slightly dried out, about 30-45 minutes (tossing a once or twice so they dry evenly. ) Cool slightly before adding to the custard.",
"While the bread is drying, soak raisins in 3 tbsp bourbon in a small bowl.",
"Make the Custard: In a large bowl, whisk together eggs, milk, cream, sugar, salt, and vanilla until dissolved.",
"Coat the baking dish with butter or spray. Add the dried bread cubes.",
"Drain the raisins, reserving bourbon. Add to custard. Pour over bread, pressing down to soak.",
"For Creamier Pudding: Refrigerate 30 minutes to overnight.",
"Pour the custard over the cubed bread, mixing and pushing down with your hands to fully submerge all of the bread.",
"For a creamier and more flavorful bread pudding: Cover and refrigerate for at least 30 minutes or overnight to allow the bread to fully soak up the custard. (If you are in a hurry, you can skip this step, but it is much better to let it soak)",
"Preheat smoker to 350°F (176°C). Smoke uncovered 50-70 minutes until puffed and golden brown and internal temperature reaches 170°F (76°C).",
"Let the bread pudding cool slightly before serving with bourbon sauce or your favorite sauce.",
"To make the bourbon sauce",
"In a saucepan over medium heat, melt butter with brown sugar, stirring until smooth.",
"Add reserved bourbon and cook 30 seconds.",
"Stir in cream and cinnamon. Simmer 5 minutes, stirring frequently.",
"Add bourbon and cook for 30 seconds before adding the cream and cinnamon. Bring to a simmer, reduce the heat and cook for about 5 minutes, stirring frequently.",
"Keep the sauce warm until ready to serve over bread pudding, or chill and gently re-heat when ready to serve."
],
"yields": "12 servings",
"description": "Elevate classic bread pudding with a kiss of smoke and decadent bourbon sauce. Cubes of bread soaked in a rich vanilla custard are smoked until golden and puffed.",
"total_time": 70,
"cook_time": 60,
"prep_time": 10,
"ratings": 5.0,
"ratings_count": 1,
"equipment": [
"Container: disposable aluminum or 12″ cast iron skillet"
],
"image": "https://saltpepperskillet.com/wp-content/uploads/smoked-bread-pudding-recipe-on-plate-overhead.jpg"
}
Loading
Loading