home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / abc.recipe < prev    next >
Text File  |  2011-09-09  |  1KB  |  44 lines

  1. import re
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class ABCRecipe(BasicNewsRecipe):
  5.   title          = u'ABC Linuxu'
  6.   oldest_article = 5
  7.   max_articles_per_feed = 3#5
  8.   __author__ = 'Funthomas'
  9.   language = 'cs'
  10.  
  11.   feeds = [
  12.     #(u'Blogy', u'http://www.abclinuxu.cz/auto/blogDigest.rss'),
  13.     (u'─îl├ínky', u'http://www.abclinuxu.cz/auto/abc.rss'),
  14.     (u'Zpr├ívi─ìky','http://www.abclinuxu.cz/auto/zpravicky.rss')
  15.   ]
  16.  
  17.   remove_javascript = True
  18.   no_stylesheets    = True
  19.   remove_attributes = ['width','height']
  20.  
  21.   remove_tags_before = dict(name='h1')
  22.   remove_tags = [
  23.     dict(attrs={'class':['meta-vypis','page_tools','cl_perex']}),
  24.     dict(attrs={'class':['cl_nadpis-link','komix-nav']})
  25.   ]
  26.  
  27.   remove_tags_after = [
  28.     dict(name='div',attrs={'class':['cl_perex','komix-nav']}),
  29.     dict(attrs={'class':['meta-vypis','page_tools']}),
  30.     dict(name='',attrs={'':''}),
  31.   ]
  32.  
  33.  
  34.   preprocess_regexps = [
  35.     (re.compile(r'</div>.*<p class="perex">', re.DOTALL),lambda match: '</div><p class="perex">')
  36.   ]
  37.   def print_version(self, url):
  38.     return url + '?varianta=print&noDiz'
  39.  
  40.   extra_css = '''
  41.             h1 {font-size:130%; font-weight:bold}
  42.             h3 {font-size:111%; font-weight:bold}
  43.         '''
  44.