From ecabc131522e7b90365a80a98ebe351b7eeca810 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Aug 2011 08:41:17 -0600 Subject: [PATCH] Hira by thomass --- recipes/hira.recipe | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 recipes/hira.recipe diff --git a/recipes/hira.recipe b/recipes/hira.recipe new file mode 100644 index 0000000000..aee6547d83 --- /dev/null +++ b/recipes/hira.recipe @@ -0,0 +1,52 @@ +# coding=utf-8 + +from calibre.web.feeds.recipes import BasicNewsRecipe + +class Hira(BasicNewsRecipe): + title = 'Hira' + __author__ = 'thomass' + description = 'مجلة حراء مجلة علمية ثقافية فكرية تصدر كل شهرين، تعنى بالعلوم الطبيعية والإنسانية والاجتماعية وتحاور أسرار النفس البشرية وآفاق الكون الشاسعة بالمنظور القرآني الإيماني في تآلف وتناسب بين العلم والإيمان، والعقل والقلب، والفكر والواقع.' + oldest_article = 63 + max_articles_per_feed = 50 + no_stylesheets = True + #delay = 1 + use_embedded_content = False + encoding = 'utf-8' + publisher = 'thomass' + category = 'News' + language = 'ar' + publication_type = 'magazine' + extra_css = ' .title-detail-wrap{ font-weight: bold ;text-align:right;color:#FF0000;font-size:25px}.title-detail{ font-family:sans-serif;text-align:right;} ' + + + conversion_options = { + 'tags' : category + ,'language' : language + ,'publisher' : publisher + ,'linearize_tables': True + ,'base-font-size':'10' + } + #html2lrf_options = [] + keep_only_tags = [ + dict(name='div', attrs={'class':['title-detail']}) + ] + + remove_tags = [ + dict(name='div', attrs={'class':['clear', 'bbsp']}), + ] + + remove_attributes = [ + 'width','height' + ] + + feeds = [ + (u'حراء', 'http://open.dapper.net/services/hira'), + ] + + def preprocess_html(self, soup): + for alink in soup.findAll('a'): + if alink.string is not None: + tstr = alink.string + alink.replaceWith(tstr) + return soup +