Skip to content

Commit

Permalink
New Site: MarthaStewart.com (#319)
Browse files Browse the repository at this point in the history
* initial commit

* adding marthastewart

* running black on files

* removing dupe import

* black on test file

Co-authored-by: Carl Anderson <[email protected]>
  • Loading branch information
weightwatchers-carlanderson and Carl Anderson authored Feb 17, 2021
1 parent 6400656 commit faf354b
Show file tree
Hide file tree
Showing 5 changed files with 5,812 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Scrapers available for:
- `https://lecremedelacrumb.com/ <https://lecremedelacrumb.com/>`_
- `https://marmiton.org/ <https://marmiton.org/>`_
- `https://matprat.no/ <https://matprat.no/>`_
- `https://www.marthastewart.com/ <https://www.marthastewart.com/>`_
- `https://www.melskitchencafe.com/ <https://www.melskitchencafe.com/>`_
- `http://mindmegette.hu/ <http://mindmegette.hu/>`_
- `https://minimalistbaker.com/ <https://minimalistbaker.com/>`_
Expand Down
2 changes: 2 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
from .lecremedelacrumb import LeCremeDeLaCrumb
from .lovingitvegan import Lovingitvegan
from .marmiton import Marmiton
from .marthastewart import MarthaStewart
from .matprat import Matprat
from .melskitchencafe import MelsKitchenCafe
from .mindmegette import Mindmegette
Expand Down Expand Up @@ -223,6 +224,7 @@
TheKitchn.host(): TheKitchn,
TheNutritiousKitchen.host(): TheNutritiousKitchen,
Marmiton.host(): Marmiton,
MarthaStewart.host(): MarthaStewart,
Matprat.host(): Matprat,
MelsKitchenCafe.host(): MelsKitchenCafe,
Mindmegette.host(): Mindmegette,
Expand Down
35 changes: 35 additions & 0 deletions recipe_scrapers/marthastewart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from ._abstract import AbstractScraper
from ._utils import get_minutes


class MarthaStewart(AbstractScraper):
@classmethod
def host(cls):
return "marthastewart.com"

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

def total_time(self):
s = (
self.soup.findAll("div", {"class": "two-subcol-content-wrapper"})[0]
.find("div", {"class": "recipe-meta-item-body"})
.text.strip()
)
return get_minutes(s)

def yields(self):
return (
self.soup.findAll("div", {"class": "two-subcol-content-wrapper"})[1]
.find("div", {"class": "recipe-meta-item-body"})
.text.strip()
)

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

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

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

0 comments on commit faf354b

Please sign in to comment.