From 6956a5ec70830b403209cca0af7eb1c80fc0229e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Jan 2011 09:39:53 -0700 Subject: [PATCH] Ledevior add support for an optional subscription --- resources/recipes/ledevoir.recipe | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/recipes/ledevoir.recipe b/resources/recipes/ledevoir.recipe index 97b33c43a7..c54f21c7ec 100644 --- a/resources/recipes/ledevoir.recipe +++ b/resources/recipes/ledevoir.recipe @@ -1,4 +1,3 @@ -#!/usr/bin/env python __license__ = 'GPL v3' __author__ = 'Lorenzo Vigentini' __copyright__ = '2009, Lorenzo Vigentini ' @@ -14,7 +13,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class ledevoir(BasicNewsRecipe): author = 'Lorenzo Vigentini' - description = 'Canadian Paper' + description = 'Canadian Paper. A subscription is optional, with it you get more content' cover_url = 'http://www.ledevoir.com/images/ul/graphiques/logo_devoir.gif' title = u'Le Devoir' @@ -28,6 +27,7 @@ class ledevoir(BasicNewsRecipe): max_articles_per_feed = 50 use_embedded_content = False recursion = 10 + needs_subscription = 'optional' remove_javascript = True no_stylesheets = True @@ -77,3 +77,12 @@ class ledevoir(BasicNewsRecipe): .credit {color:#787878;font-size:0.71em;line-height:1.1em;font-weight:bold;} .texte {font-size:1.15em;line-height:1.4em;margin-bottom:17px;} ''' + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None and self.password is not None: + br.open('http://www.ledevoir.com') + br.select_form(nr=1) + br['login[courriel]'] = self.username + br['login[password]'] = self.password + br.submit() + return br