[cookboob] author field added
This commit is contained in:
parent
b0d9a43a76
commit
d391d1a2d8
8 changed files with 32 additions and 2 deletions
|
|
@ -57,6 +57,7 @@ class CuisineazBackend(BaseBackend, ICapRecipe):
|
|||
recipe.instructions = rec.instructions
|
||||
recipe.ingredients = rec.ingredients
|
||||
recipe.comments = rec.comments
|
||||
recipe.author = rec.author
|
||||
recipe.nb_person = rec.nb_person
|
||||
recipe.cooking_time = rec.cooking_time
|
||||
recipe.preparation_time = rec.preparation_time
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class ResultsPage(BasePage):
|
|||
recipe.nb_person = NotLoaded
|
||||
recipe.cooking_time = NotLoaded
|
||||
recipe.preparation_time = NotLoaded
|
||||
recipe.author = NotLoaded
|
||||
yield recipe
|
||||
|
||||
|
||||
|
|
@ -80,6 +81,7 @@ class RecipePage(BasePage):
|
|||
title = NotAvailable
|
||||
preparation_time = NotAvailable
|
||||
cooking_time = NotAvailable
|
||||
author = NotAvailable
|
||||
nb_person = NotAvailable
|
||||
ingredients = NotAvailable
|
||||
picture_url = NotAvailable
|
||||
|
|
@ -128,6 +130,10 @@ class RecipePage(BasePage):
|
|||
comments.append('author: %s, date: %s, text: %s' % (
|
||||
author, date, comtxt))
|
||||
|
||||
spans_author = self.parser.select(self.document.getroot(), 'span.author')
|
||||
if len(spans_author) > 0:
|
||||
author = unicode(spans_author[0].text_content().strip())
|
||||
|
||||
recipe = Recipe(id, title)
|
||||
recipe.preparation_time = preparation_time
|
||||
recipe.cooking_time = cooking_time
|
||||
|
|
@ -136,5 +142,6 @@ class RecipePage(BasePage):
|
|||
recipe.instructions = instructions
|
||||
recipe.picture_url = picture_url
|
||||
recipe.comments = comments
|
||||
recipe.author = author
|
||||
recipe.thumbnail_url = NotLoaded
|
||||
return recipe
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue