From 574840f8841da5b59f5be6dc69423459ddf8dcde Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 18 Jun 2012 09:20:18 +0530 Subject: [PATCH] Homopedia.pl by rainbowwarrior --- recipes/homopedia_pl.recipe | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 recipes/homopedia_pl.recipe diff --git a/recipes/homopedia_pl.recipe b/recipes/homopedia_pl.recipe new file mode 100644 index 0000000000..b0a97b90cf --- /dev/null +++ b/recipes/homopedia_pl.recipe @@ -0,0 +1,28 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1325420346(BasicNewsRecipe): + title = u'Homopedia' + __author__ = 'rainbowwarrior' + language = 'pl' + oldest_article = 7 + max_articles_per_feed = 100 + publication_type = 'newspaper' + masthead_url = 'http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc6/67335_168352243178437_166186720061656_594975_5800720_n.jpg' + encoding = 'utf-8' + + def get_cover_url(self): + return 'http://a7.sphotos.ak.fbcdn.net/hphotos-ak-snc4/65568_166186970061631_166186720061656_580324_7584264_n.jpg' + + feeds = [(u'Nowe has\u0142a', u'http://www.homopedia.pl/w/index.php?title=Specjalna:Nowe_strony&feed=atom&hideliu=&hidepatrolled=&hidebots=&hideredirs=1&limit=50&namespace=0'), (u'Blog', u'http://blog.homopedia.pl/feeds/posts/default')] + + def get_article_url(self, article): + artl = article.get('link', None) + rest, sep, article_id = artl.rpartition('/') + return 'http://www.homopedia.pl/w/index.php?redirect=no&printable=yes&title=' + article_id + + remove_tags = [dict(name='div', attrs={'class':'noprint'}),dict(name='ul', attrs={'class':'noprint'}),dict(name='ul', attrs={'id':'footer-places'}),dict(name='li', attrs={'id':'footer-info-viewcount'}),dict(name='span', attrs={'class':'editsection'}),dict(name='div', attrs={'id':'jump-to-nav'})] + + remove_tags_before = dict(dict(name = 'h2', attrs = {'class' : 'post-title'})) + remove_tags_after = dict(dict(name = 'a', attrs = {'class' : 'timestamp-link'})) + + extra_css = 'p{text-indent:1.5em!important;padding:0!important;margin;0!important}'