[cookboob] author field added
This commit is contained in:
parent
b0d9a43a76
commit
d391d1a2d8
8 changed files with 32 additions and 2 deletions
|
|
@ -50,6 +50,7 @@ class SevenFiftyGramsBackend(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
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class ResultsPage(BasePage):
|
|||
recipe.nb_person = NotLoaded
|
||||
recipe.cooking_time = NotLoaded
|
||||
recipe.preparation_time = NotLoaded
|
||||
recipe.author = NotLoaded
|
||||
yield recipe
|
||||
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ class RecipePage(BasePage):
|
|||
ingredients = NotAvailable
|
||||
picture_url = NotAvailable
|
||||
instructions = NotAvailable
|
||||
author = NotAvailable
|
||||
comments = []
|
||||
|
||||
title = unicode(self.parser.select(self.document.getroot(), 'head > title', 1).text.split(' - ')[1])
|
||||
|
|
@ -120,6 +122,11 @@ class RecipePage(BasePage):
|
|||
if u'| Répondre' in comtxt:
|
||||
comtxt = comtxt.strip('0123456789').replace(u' | Répondre', '')
|
||||
comments.append(comtxt)
|
||||
|
||||
links_author = self.parser.select(self.document.getroot(), 'p.auteur a.couleur_membre')
|
||||
print links_author[0].text.strip()
|
||||
if len(links_author) > 0:
|
||||
author = unicode(links_author[0].text.strip())
|
||||
|
||||
recipe = Recipe(id, title)
|
||||
recipe.preparation_time = preparation_time
|
||||
|
|
@ -129,5 +136,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