From b9b2e386c8290ed301d703fcad27c411467d334f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Jan 2012 17:17:57 +0530 Subject: [PATCH] Update Eret es irodalom for subscription content --- recipes/elet_es_irodalom.recipe | 58 +++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/recipes/elet_es_irodalom.recipe b/recipes/elet_es_irodalom.recipe index 9cebd55f23..944096547e 100644 --- a/recipes/elet_es_irodalom.recipe +++ b/recipes/elet_es_irodalom.recipe @@ -1,16 +1,16 @@ ################################################################################ -#Description: http://es.hu/ RSS channel -#Author: Bigpapa (bigpapabig@hotmail.com) -#Date: 2010.12.01. - V1.0 +#Description: http://es.hu/ RSS channel +#Author: Bigpapa (bigpapabig@hotmail.com) +#Date: 2012.01.20. - V1.2 ################################################################################ from calibre.web.feeds.recipes import BasicNewsRecipe class elet_es_irodalom(BasicNewsRecipe): - title = u'Elet es Irodalom' + title = u'\u00c9let \u00e9s Irodalom' __author__ = 'Bigpapa' oldest_article = 7 - max_articles_per_feed = 20 # Az adott e-bookban tarolt cikkek feedenkenti maximalis szamat adja meg. + max_articles_per_feed = 30 # Az adott e-bookban tarolt cikkek feedenkenti maximalis szamat adja meg. no_stylesheets = True #delay = 1 use_embedded_content = False @@ -19,30 +19,40 @@ class elet_es_irodalom(BasicNewsRecipe): language = 'hu' publication_type = 'newsportal' extra_css = '.doc_title { font: bold 30px } .doc_author {font: bold 14px} ' + needs_subscription = 'optional' + + masthead_url = 'http://www.es.hu/images/logo.jpg' + timefmt = ' [%Y %b %d, %a]' + +#Nem ide a kódba kell beleírni a hozzáférés adatait, hanem azt akkor adod meg, ha le akarod tölteni! + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None and self.password is not None: + br.open('http://www.es.hu/') + br.select_form(name='userfrmlogin') + br['cusername'] = self.username + br['cpassword'] = self.password + br.submit() + return br keep_only_tags = [ dict(name='div', attrs={'class':['doc_author', 'doc_title', 'doc']}) - - ] + ] remove_tags = [ - dict(name='a', attrs={'target':['_TOP']}), - dict(name='div', attrs={'style':['float: right; margin-left: 5px; margin-bottom: 5px;', 'float: right; margin-left: 5px; margin-bottom: 5px;']}), - + dict(name='a', attrs={'target':['_TOP']}), + dict(name='div', attrs={'style':['float: right; margin-left: 5px; margin-bottom: 5px;', 'float: right; margin-left: 5px; margin-bottom: 5px;']}), - ] - - + ] feeds = [ - (u'Publicisztika', 'http://www.feed43.com/4684235031168504.xml'), - (u'Interj\xfa', 'http://www.feed43.com/4032465460040618.xml'), - (u'Visszhang', 'http://www.feed43.com/3727375706873086.xml'), - (u'P\xe1ratlan oldal', 'http://www.feed43.com/2525784782475057.xml'), - (u'Feuilleton', 'http://www.feed43.com/7216025082703073.xml'), - (u'Pr\xf3za', 'http://www.feed43.com/8760248802326384.xml'), - (u'Vers', 'http://www.feed43.com/1737324675134275.xml'), - (u'K\xf6nyvkritika', 'http://www.feed43.com/1281156550717082.xml'), - (u'M\u0171b\xedr\xe1lat', 'http://www.feed43.com/1851854623681044.xml') - - ] \ No newline at end of file + (u'Publicisztika', 'http://www.feed43.com/4684235031168504.xml'), + (u'Interj\xfa', 'http://www.feed43.com/4032465460040618.xml'), + (u'Visszhang', 'http://www.feed43.com/3727375706873086.xml'), + (u'P\xe1ratlan oldal', 'http://www.feed43.com/2525784782475057.xml'), + (u'Feuilleton', 'http://www.feed43.com/7216025082703073.xml'), + (u'Pr\xf3za', 'http://www.feed43.com/8760248802326384.xml'), + (u'Vers', 'http://www.feed43.com/1737324675134275.xml'), + (u'K\xf6nyvkritika', 'http://www.feed43.com/1281156550717082.xml'), + (u'M\u0171b\xedr\xe1lat', 'http://www.feed43.com/1851854623681044.xml') + ]