Skip to content

Commit

Permalink
Add support for celebratingsweets.com, ingoodflavor.com, kitchenaid.c…
Browse files Browse the repository at this point in the history
…om.au, leitesculinaria.com, myvegetarianroots.com, peelwithzeal.com and sandwichtribunal.com (#1196)
  • Loading branch information
jknndy authored Aug 16, 2024
1 parent 461e9b7 commit 0b72b36
Show file tree
Hide file tree
Showing 35 changed files with 17,696 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Scrapers available for:
- `https://carlsbadcravings.com/ <https://carlsbadcravings.com/>`_
- `https://castironketo.net/ <https://castironketo.net/>`_
- `https://cdkitchen.com/ <https://cdkitchen.com/>`_
- `https://celebratingsweets.com/ <https://celebratingsweets.com/>`_
- `https://chefkoch.de/ <https://chefkoch.de>`_
- `https://www.chefnini.com/ <https://www.chefnini.com/>`_
- `https://chefsavvy.com/ <https://chefsavvy.com/>`_
Expand Down Expand Up @@ -221,6 +222,7 @@ Scrapers available for:
- `https://www.im-worthy.com/ <https://www.im-worthy.com>`_
- `https://inbloombakery.com/ <https://inbloombakery.com/>`_
- `https://indianhealthyrecipes.com <https://www.indianhealthyrecipes.com>`_
- `https://ingoodflavor.com <https://www.ingoodflavor.com>`_
- `https://www.innit.com/ <https://www.innit.com/>`_
- `https://insanelygoodrecipes.com <https://insanelygoodrecipes.com/>`_
- `https://inspiralized.com/ <https://inspiralized.com>`_
Expand All @@ -240,6 +242,7 @@ Scrapers available for:
- `https://keukenliefde.nl/ <https://keukenliefde.nl>`_
- `https://www.kingarthurbaking.com <https://www.kingarthurbaking.com>`_
- `https://kitchenaid.com.au/ <https://kitchenaid.com.au/blogs/kitchenthusiast/tagged/blog-category-recipes>`_
- `https://www.kitchendreaming.com <https://www.kitchendreaming.com>`_
- `https://www.kitchensanctuary.com/ <https://www.kitchensanctuary.com>`_
- `https://www.kitchenstories.com/ <https://www.kitchenstories.com>`_
- `https://kochbar.de/ <https://kochbar.de>`_
Expand All @@ -253,6 +256,7 @@ Scrapers available for:
- `https://leanandgreenrecipes.net <https://leanandgreenrecipes.net>`_
- `https://www.lecker.de <https://www.lecker.de/rezepte>`_
- `https://lecremedelacrumb.com/ <https://lecremedelacrumb.com/>`_
- `https://leitesculinaria.com <https://leitesculinaria.com>`_
- `https://lekkerensimpel.com <https://lekkerensimpel.com>`_
- `https://leukerecepten.nl/ <https://www.leukerecepten.nl>`_
- `https://lifestyleofafoodie.com <https://lifestyleofafoodie.com>`_
Expand Down Expand Up @@ -288,6 +292,7 @@ Scrapers available for:
- `https://mykoreankitchen.com/ <https://mykoreankitchen.com>`_
- `https://www.myplate.gov/ <https://www.myplate.gov/>`_
- `https://myrecipes.com/ <https://myrecipes.com>`_
- `https://myvegetarianroots.com/ <https://myvegetarianroots.com/>`_
- `https://www.nhs.uk/healthier-families/ <https://www.nhs.uk/healthier-families/>`_
- `https://nibbledish.com/ <https://nibbledish.com>`_
- `https://norecipes.com/ <https://norecipes.com/>`_
Expand All @@ -306,6 +311,7 @@ Scrapers available for:
- `https://www.paleorunningmomma.com/ <https://www.paleorunningmomma.com>`_
- `https://www.panelinha.com.br/ <https://www.panelinha.com.br>`_
- `https://paninihappy.com/ <https://paninihappy.com>`_
- `https://www.peelwithzeal.com/ <https://www.peelwithzeal.com/>`_
- `https://www.persnicketyplates.com/ <https://www.persnicketyplates.com/>`_
- `https://www.pickuplimes.com/ <https://www.pickuplimes.com/>`_
- `https://pinchofyum.com/ <https://pinchofyum.com/>`_
Expand Down Expand Up @@ -348,6 +354,7 @@ Scrapers available for:
- `https://sallys-blog.de <https://sallys-blog.de/>`_
- `https://sallysbakingaddiction.com <https://sallysbakingaddiction.com/>`_
- `https://saltpepperskillet.com/ <https://saltpepperskillet.com/>`_
- `https://sandwichtribunal.com/ <https://sandwichtribunal.com/>`_
- `https://www.saveur.com/ <https://www.saveur.com/>`_
- `https://www.savorynothings.com/ <https://www.savorynothings.com/>`_
- `https://seriouseats.com/ <https://seriouseats.com>`_
Expand Down
14 changes: 14 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
from .carlsbadcravings import CarlsBadCravings
from .castironketo import CastIronKeto
from .cdkitchen import CdKitchen
from .celebratingsweets import CelebratingSweets
from .chefkoch import Chefkoch
from .chefnini import Chefnini
from .chefsavvy import ChefSavvy
Expand Down Expand Up @@ -171,6 +172,7 @@
from .imworthy import ImWorthy
from .inbloombakery import InBloomBakery
from .indianhealthyrecipes import IndianHealthyRecipes
from .ingoodflavor import InGoodFlavor
from .innit import Innit
from .insanelygoodrecipes import InsanelyGoodRecipes
from .inspiralized import Inspiralized
Expand All @@ -190,6 +192,7 @@
from .keukenliefdenl import KeukenLiefdeNL
from .kingarthur import KingArthur
from .kitchenaidaustralia import KitchenAidAustralia
from .kitchendreaming import KitchenDreaming
from .kitchensanctuary import KitchenSanctuary
from .kitchenstories import KitchenStories
from .kochbar import Kochbar
Expand All @@ -203,6 +206,7 @@
from .leanandgreenrecipes import LeanAndGreenRecipes
from .lecker import Lecker
from .lecremedelacrumb import LeCremeDeLaCrumb
from .leitesculinaria import LeitesCulinaria
from .lekkerensimpel import LekkerEnSimpel
from .leukerecepten import Leukerecepten
from .lifestyleofafoodie import LifestyleOfAFoodie
Expand Down Expand Up @@ -237,6 +241,7 @@
from .mykitchen101en import MyKitchen101en
from .mykoreankitchen import MyKoreanKitchen
from .myrecipes import MyRecipes
from .myvegetarianroots import MyVegetarianRoots
from .nhshealthierfamilies import NHSHealthierFamilies
from .nibbledish import NibbleDish
from .nihhealthyeating import NIHHealthyEating
Expand All @@ -258,6 +263,7 @@
from .paleorunningmomma import PaleoRunningMomma
from .panelinha import Panelinha
from .paninihappy import PaniniHappy
from .peelwithzeal import PeelWithZeal
from .persnicketyplates import PersnicketyPlates
from .pickuplimes import PickUpLimes
from .pinchofyum import PinchOfYum
Expand Down Expand Up @@ -295,6 +301,7 @@
from .sallysbakingaddiction import SallysBakingAddiction
from .sallysblog import SallysBlog
from .saltpepperskillet import SaltPepperSkillet
from .sandwhichtribunal import SandwhichTribunal
from .saveur import Saveur
from .savorynothings import SavoryNothings
from .seriouseats import SeriousEats
Expand Down Expand Up @@ -431,6 +438,7 @@
CarlsBadCravings.host(): CarlsBadCravings,
CastIronKeto.host(): CastIronKeto,
CdKitchen.host(): CdKitchen,
CelebratingSweets.host(): CelebratingSweets,
ChefSavvy.host(): ChefSavvy,
Chefkoch.host(): Chefkoch,
Chefnini.host(): Chefnini,
Expand Down Expand Up @@ -468,30 +476,36 @@
GrandFrais.host(): GrandFrais,
HeatherChristo.host(): HeatherChristo,
InBloomBakery.host(): InBloomBakery,
InGoodFlavor.host(): InGoodFlavor,
JoCooks.host(): JoCooks,
JoshuaWeissman.host(): JoshuaWeissman,
JoyTheBaker.host(): JoyTheBaker,
KaleJunkie.host(): KaleJunkie,
KitchenAidAustralia.host(): KitchenAidAustralia,
KitchenDreaming.host(): KitchenDreaming,
KristinesKitchenBlog.host(): KristinesKitchenBlog,
KuchynaLidla.host(): KuchynaLidla,
LittleSunnyKitchen.host(): LittleSunnyKitchen,
LeitesCulinaria.host(): LeitesCulinaria,
McCormick.host(): McCormick,
ModernHoney.host(): ModernHoney,
MomOnTimeout.host(): MomOnTimeout,
Moulinex.host(): Moulinex,
MundoDeReceitasBimby.host(): MundoDeReceitasBimby,
MyJewishLearning.host(): MyJewishLearning,
MyKoreanKitchen.host(): MyKoreanKitchen,
MyVegetarianRoots.host(): MyVegetarianRoots,
NotEnoughCinnamon.host(): NotEnoughCinnamon,
NutritionFacts.host(): NutritionFacts,
OneSweetAppetite.host(): OneSweetAppetite,
PeelWithZeal.host(): PeelWithZeal,
PinchOfYum.host(): PinchOfYum,
PotatoRolls.host(): PotatoRolls,
Recept.host(): Recept,
ReceptyPreVas.host(): ReceptyPreVas,
RecipeGirl.host(): RecipeGirl,
RicettePerBimby.host(): RicettePerBimby,
SandwhichTribunal.host(): SandwhichTribunal,
SavoryNothings.host(): SavoryNothings,
StrongrFastr.host(): StrongrFastr,
TasteAtlas.host(): TasteAtlas,
Expand Down
16 changes: 16 additions & 0 deletions recipe_scrapers/celebratingsweets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class CelebratingSweets(AbstractScraper):
@classmethod
def host(cls):
return "celebratingsweets.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
31 changes: 31 additions & 0 deletions recipe_scrapers/ingoodflavor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class InGoodFlavor(AbstractScraper):
@classmethod
def host(cls):
return "ingoodflavor.com"

def author(self):
signature_div = self.soup.find("div", class_="text-signature")
signature_text = signature_div.get_text(strip=True) if signature_div else None
schema_author = self.schema.author()

if signature_text and schema_author:
return f"{signature_text} | {schema_author}"
return schema_author

def ingredient_groups(self):
groups = group_ingredients(
self.ingredients(),
self.soup,
".dr-title",
".dr-ingredient-name",
)

for group in groups:
if group.purpose and group.purpose.strip().lower() == "ingredients":
group.purpose = None

return groups
16 changes: 16 additions & 0 deletions recipe_scrapers/kitchendreaming.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class KitchenDreaming(AbstractScraper):
@classmethod
def host(cls):
return "kitchendreaming.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group-name",
".wprm-recipe-ingredient",
)
16 changes: 16 additions & 0 deletions recipe_scrapers/leitesculinaria.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class LeitesCulinaria(AbstractScraper):
@classmethod
def host(cls):
return "leitesculinaria.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-group-name",
".wprm-recipe-ingredient",
)
16 changes: 16 additions & 0 deletions recipe_scrapers/myvegetarianroots.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class MyVegetarianRoots(AbstractScraper):
@classmethod
def host(cls):
return "myvegetarianroots.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
25 changes: 25 additions & 0 deletions recipe_scrapers/peelwithzeal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients
from ._utils import get_equipment


class PeelWithZeal(AbstractScraper):
@classmethod
def host(cls):
return "peelwithzeal.com"

def equipment(self):
equipment_items = [
equip.get_text()
for equip in self.soup.find_all("div", class_="wprm-recipe-equipment-name")
if equip.get_text()
]
return get_equipment(equipment_items)

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
7 changes: 7 additions & 0 deletions recipe_scrapers/sandwhichtribunal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from ._abstract import AbstractScraper


class SandwhichTribunal(AbstractScraper):
@classmethod
def host(cls):
return "sandwichtribunal.com"
50 changes: 50 additions & 0 deletions tests/test_data/celebratingsweets.com/celebratingsweets_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"author": "Allison",
"canonical_url": "https://celebratingsweets.com/berries-and-cream-trifle/",
"site_name": "Celebrating Sweets",
"host": "celebratingsweets.com",
"language": "en-US",
"title": "Berry Trifle",
"ingredients": [
"2 1/2 cups cold heavy cream",
"1/2 cup powdered sugar",
"1 1/2 teaspoons pure vanilla extract",
"1/4 teaspoon almond extract",
"8 - 10 cups cubed pound cake or angel food cake (see note)",
"16 ounces strawberries (sliced)",
"6 ounces raspberries",
"6 ounces blackberries",
"6 ounces blueberries",
"1/2 cup raspberry or strawberry jam (heated just enough to make it pourable (not hot))"
],
"instructions": "With a hand mixer or stand mixer fitted with a whisk attachment, beat heavy cream*, powdered sugar, vanilla and almond extract until soft peaks form, this will take several minutes. Keep the whipped cream refrigerated while you assemble the other components of the recipe.\nIn a large trifle dish (or individual glasses), layer the cake, whipped cream, berries, and jam. You can layer it anyway you like. I did the following (from the bottom up): whipped cream, cake, berries, whipped cream, cake, jam, whipped cream, berries.",
"instructions_list": [
"With a hand mixer or stand mixer fitted with a whisk attachment, beat heavy cream*, powdered sugar, vanilla and almond extract until soft peaks form, this will take several minutes. Keep the whipped cream refrigerated while you assemble the other components of the recipe.",
"In a large trifle dish (or individual glasses), layer the cake, whipped cream, berries, and jam. You can layer it anyway you like. I did the following (from the bottom up): whipped cream, cake, berries, whipped cream, cake, jam, whipped cream, berries."
],
"category": "Dessert",
"yields": "10 servings",
"description": "This easy trifle includes layers of cake, fresh berries, and whipped cream. Take a shortcut with store bought pound cake or angel food cake, or make your own. You'll love this simple and beautiful red, white, and blue dessert!",
"total_time": 25,
"cook_time": 5,
"prep_time": 25,
"cuisine": "Dessert",
"ratings": 5.0,
"ratings_count": 8,
"nutrients": {
"calories": "399 kcal",
"carbohydrateContent": "46 g",
"proteinContent": "5 g",
"fatContent": "22 g",
"saturatedFatContent": "13 g",
"cholesterolContent": "81 mg",
"sodiumContent": "279 mg",
"fiberContent": "3 g",
"sugarContent": "26 g",
"servingSize": "1 serving"
},
"image": "https://celebratingsweets.com/wp-content/uploads/2015/06/Berries-Cream-Trifle-2.jpg",
"keywords": [
"Trifle"
]
}
Loading

0 comments on commit 0b72b36

Please sign in to comment.