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

  1. import re
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class AdvancedUserRecipe1289939440(BasicNewsRecipe):
  5.   __author__  = 'FunThomas'
  6.   title       = u'Root.cz'
  7.   description = u'Zpr├ívi─ìky a ─ìl├ínky z Root.cz'
  8.   publisher   = u'Internet Info, s.r.o'
  9.   oldest_article = 2               #max stari clanku ve dnech
  10.   max_articles_per_feed = 50       #max pocet clanku na feed
  11.  
  12.   feeds = [
  13.     (u'─îl├ínky', u'http://www.root.cz/rss/clanky/'),
  14.     (u'Zpr├ívi─ìky', u'http://www.root.cz/rss/zpravicky/')
  15.   ]
  16.  
  17.   publication_type = u'magazine'
  18.   language = u'cs'
  19.   no_stylesheets = True
  20.   remove_javascript = True
  21.   cover_url = u'http://i.iinfo.cz/urs/logo-root-bila-oranzova-cerna-111089527143118.gif'
  22.  
  23.   remove_attributes = ['width','height','href'] #,'href'
  24.   keep_only_tags = [
  25.     dict(name='h1'),
  26.     dict(name='a',attrs={'class':'author'}),
  27.     dict(name='p', attrs={'class':'intro'}),
  28.     dict(name='div',attrs={'class':'urs'})
  29.   ]
  30.  
  31.   preprocess_regexps = [
  32.     (re.compile(u'<p class="perex[^"]*">[^<]*<img[^>]*>', re.DOTALL),lambda match: '<p class="intro">'),
  33.     (re.compile(u'<h3><a name="tucnak">Tri─ìko tu─ì┼ê├ík.*</body>', re.DOTALL),lambda match: '<!--deleted-->')
  34.   ]
  35.  
  36.   extra_css = '''
  37.                 h1 {font-size:130%; font-weight:bold}
  38.                 h3 {font-size:111%; font-weight:bold}
  39.               '''
  40.