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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2. import re
  3.  
  4. class YahooNews(BasicNewsRecipe):
  5.     title               = 'Yahoo News'
  6.     __author__          = 'Starson17'
  7.     description         = 'Yahoo-Science'
  8.     language            = 'en'
  9.     use_embedded_content= False
  10.     no_stylesheets      = True
  11.     linearize_tables      = True
  12.     oldest_article      = 24
  13.     remove_javascript   = True
  14.     remove_empty_feeds    = True
  15.     max_articles_per_feed = 10
  16.  
  17.     feeds = [#There are dozens of other feeds at http://news.yahoo.com/rss
  18.              (u'Top Stories', u'http://rss.news.yahoo.com/rss/topstories'),
  19.              (u'Science', u'http://rss.news.yahoo.com/rss/science')
  20.              ]
  21.  
  22.     keep_only_tags     = [dict(name='div', attrs={'id':'yn-story'})]
  23.  
  24.     remove_tags     = [dict(name='div', attrs={'class':['hd', 'ft', 'yn-share-social']}),
  25.                                    dict(name='div', attrs={'id':['yn-story-minor-media']})]
  26.  
  27.     preprocess_regexps = [(re.compile(r'<span>Play Video</span>', re.DOTALL),lambda match: '<span></span>')]
  28.  
  29.     extra_css = '''
  30.                     h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
  31.                     h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
  32.                     p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
  33.                     body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
  34.         '''
  35.