Skip to content

Commit

Permalink
Add "A Healthy Slice of Life" site (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcspragu authored Dec 7, 2024
1 parent 5b7abc9 commit be18baf
Show file tree
Hide file tree
Showing 5 changed files with 2,344 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Scrapers available for:
- `http://www.afghankitchenrecipes.com/ <http://www.afghankitchenrecipes.com/>`_
- `https://aflavorjournal.com/ <https://aflavorjournal.com/>`_
- `https://ah.nl/ <https://ah.nl/>`_
- `https://www.ahealthysliceoflife.com/ <https://www.ahealthysliceoflife.com/>`_
- `https://akispetretzikis.com/ <https://akispetretzikis.com/>`_
- `https://aldi-nord.de/ <https://aldi-nord.de/>`_
- `.es <https://aldi.es/>`__, `.fr <https://aldi.fr/>`__, `.lu <https://aldi.lu/>`__, `.nl <https://aldi.nl/>`__, `.pl <https://aldi.pl/>`__, `.pt <https://aldi.pt/>`__
Expand Down
2 changes: 2 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from .addapinch import AddAPinch
from .afghankitchenrecipes import AfghanKitchenRecipes
from .aflavorjournal import AFlavorJournal
from .ahealthysliceoflife import AHealthySliceOfLife
from .akispetretzikis import AkisPetretzikis
from .albertheijn import AlbertHeijn
from .aldi import Aldi
Expand Down Expand Up @@ -428,6 +429,7 @@
ABeautifulMess.host(): ABeautifulMess,
ACoupleCooks.host(): ACoupleCooks,
AFlavorJournal.host(): AFlavorJournal,
AHealthySliceOfLife.host(): AHealthySliceOfLife,
ALittleBitYummy.host(): ALittleBitYummy,
AberleHome.host(): AberleHome,
Abril.host(): Abril,
Expand Down
38 changes: 38 additions & 0 deletions recipe_scrapers/ahealthysliceoflife.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from ._abstract import AbstractScraper
from ._utils import normalize_string


class AHealthySliceOfLife(AbstractScraper):
@classmethod
def host(cls):
return "ahealthysliceoflife.com"

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

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

def category(self):
return self.schema.category()

def image(self):
return self.schema.image()

def ingredients(self):
ingredients = self.soup.find(
"div", {"class": "tasty-recipes-ingredients-body"}
).findAll("p")
return [normalize_string(ing.get_text().strip()) for ing in ingredients]

def instructions(self):
return self.schema.instructions()

def ratings(self):
return self.schema.ratings()

def cuisine(self):
return self.schema.cuisine()

def description(self):
return self.schema.description()
31 changes: 31 additions & 0 deletions tests/test_data/ahealthysliceoflife.com/ahealthysliceoflife.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"author": "Brittany Dixon",
"canonical_url": "https://www.ahealthysliceoflife.com/red-lentil-carrot-curry-recipe/",
"site_name": "A Healthy Slice of Life",
"host": "ahealthysliceoflife.com",
"language": "en-US",
"title": "Red Lentil and Carrot Curry Recipe",
"ingredients": [
"3 Tbsp olive oil",
"3 garlic cloves, minced",
"1.5 tsp grated ginger",
"1 small onion, small diced (about 1 c)",
"2 large carrots, small diced (about 1 c)",
"1.5 Tbsp curry powder",
"1 tsp turmeric",
"1.5 c red lentils",
"1.5 tsp salt",
"1 c vegetable broth",
"1 can full fat coconut milk",
"3 oz chopped baby spinach",
"Juice of half a lime"
],
"instructions_list": [
"In a large pan, heat oil over medium heat.",
"Add onion and carrots. Sauté 4 minutes until onions are beginning to soften. Add garlic, ginger, curry powder, and turmeric to the pan and sauté for 1-2 minutes more, until fragrant.",
"Add lentils, salt, broth, and coconut milk to the pan. Bring to a boil while mixing well, then cover and reduce heat to a gentle simmer. Let simmer for 20 minutes, then remove from heat.",
"Take off the lid, add spinach and lime juice and stir to combine. Serve over hot buttered rice."
],
"description": "This nourishing curry recipe is perfect for when you need something comforting and delicious on the dinner table quickly!",
"image": "https://www.ahealthysliceoflife.com/wp-content/uploads/2021/08/A-Healthy-Slice_Lentil-Curry-9-scaled-225x225.jpg"
}
2,272 changes: 2,272 additions & 0 deletions tests/test_data/ahealthysliceoflife.com/ahealthysliceoflife.testhtml

Large diffs are not rendered by default.

0 comments on commit be18baf

Please sign in to comment.