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_au.recipe < prev    next >
Text File  |  2011-09-09  |  3KB  |  55 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Dean Cording'
  3. '''
  4. abc.net.au/news
  5. '''
  6. import re
  7. from calibre.web.feeds.recipes import BasicNewsRecipe
  8.  
  9. class ABCNews(BasicNewsRecipe):
  10.     title                  = 'ABC News'
  11.     __author__             = 'Dean Cording'
  12.     description            = 'News from Australia'
  13.     masthead_url           = 'http://www.abc.net.au/news/assets/v5/images/common/logo-news.png'
  14.     cover_url              = 'http://www.abc.net.au/news/assets/v5/images/common/logo-news.png'
  15.  
  16.     oldest_article         = 2
  17.     max_articles_per_feed  = 100
  18.     no_stylesheets         = False
  19.     #delay                  = 1
  20.     use_embedded_content   = False
  21.     encoding               = 'utf8'
  22.     publisher              = 'ABC News'
  23.     category               = 'News, Australia, World'
  24.     language               = 'en_AU'
  25.     publication_type       = 'newsportal'
  26.     preprocess_regexps     = [(re.compile(r'<!--.*?-->', re.DOTALL), lambda m: '')]
  27.     conversion_options = {
  28.                              'comments'        : description
  29.                             ,'tags'            : category
  30.                             ,'language'        : language
  31.                             ,'publisher'       : publisher
  32.                             ,'linearize_tables': False
  33.                          }
  34.  
  35.     keep_only_tags    =  dict(id='article')
  36.  
  37.     remove_tags = [dict(attrs={'class':['related', 'tags']}),
  38.                      dict(id='statepromo')
  39.                         ]
  40.  
  41.     remove_attributes = ['width','height']
  42.  
  43.     feeds          = [
  44.                       ('Top Stories', 'http://www.abc.net.au/news/syndicate/topstoriesrss.xml'),
  45.                       ('Canberra', 'http://www.abc.net.au/news/indexes/idx-act/rss.xml'),
  46.                       ('Sydney', 'http://www.abc.net.au/news/indexes/sydney/rss.xml'),
  47.                       ('Melbourne', 'http://www.abc.net.au/news/indexes/melbourne/rss.xml'),
  48.                       ('Brisbane', 'http://www.abc.net.au/news/indexes/brisbane/rss.xml'),
  49.                       ('Perth', 'http://www.abc.net.au/news/indexes/perth/rss.xml'),
  50.                       ('Australia', 'http://www.abc.net.au/news/indexes/idx-australia/rss.xml'),
  51.                       ('World', 'http://www.abc.net.au/news/indexes/world/rss.xml'),
  52.                       ('Business', 'http://www.abc.net.au/news/indexes/business/rss.xml'),
  53.                       ('Science and Technology', 'http://www.abc.net.au/news/tag/science-and-technology/rss.xml'),
  54.                     ]
  55.