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

  1. # -*- coding: utf-8 -*-
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = 'Marcin Urban 2011'
  5.  
  6. import re
  7. from calibre.web.feeds.recipes import BasicNewsRecipe
  8.  
  9. class recipeMagic(BasicNewsRecipe):
  10.     title                  = 'National Geographic PL'
  11.     __author__             = 'Marcin Urban 2011'
  12.     description            = 'legenda w┼¢r├│d magazyn├│w z histori─à si─Ögaj─àc─à 120 lat'
  13.     cover_url                 = 'http://www.guj.pl/var/guj/storage/images/media/nasze_magazyny/national_geographic/logo/ng_logo/2606-1-pol-PL/ng_logo.jpg'
  14.     oldest_article         = 7
  15.     max_articles_per_feed  = 100
  16.     no_stylesheets         = True
  17.     #delay                 = 1
  18.     use_embedded_content   = False
  19.     encoding               = 'utf8'
  20.     publisher              = 'G+J Gruner+Jahr Polska'
  21.     category               = 'news, PL,'
  22.     language               = 'pl'
  23.     publication_type       = 'newsportal'
  24.     extra_css              = ''' body {font-family: verdana, arial, helvetica, geneva, sans-serif ;}
  25.                         h1{text-align: center;}
  26.                             h2{font-size: medium; font-weight: bold;}
  27.                             .authordate {font-size: small; color: #696969;}
  28.                             p.lead {font-weight: bold; text-align: center;}
  29.                             .fot{font-size: x-small; color: #666666;} '''
  30.     preprocess_regexps     = [(re.compile(r'<!--.*?-->', re.DOTALL), lambda m: '')]
  31.     conversion_options = {
  32.                              'comments'        : description
  33.                             ,'tags'            : category
  34.                             ,'language'        : language
  35.                             ,'publisher'       : publisher
  36.                             ,'linearize_tables': True
  37.                          }
  38.  
  39.     remove_tags     = [
  40.             dict(name='div', attrs={'class':'add_inf'}),
  41.             dict(name='div', attrs={'class':'add_f'}),
  42.                         ]
  43.  
  44.     remove_attributes = ['width','height']
  45.  
  46.     feeds          = [
  47.                       ('National Geographic PL', 'http://www.national-geographic.pl/rss/'),
  48.                     ]
  49.  
  50.     def print_version(self, url):
  51.         return url.replace('artykuly0Cpokaz', 'drukuj-artykul')
  52.  
  53.