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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class SecurityWatch(BasicNewsRecipe):
  4.     title          = u'securitywatch'
  5.     description = 'security news'
  6.     timefmt  = ' [%d %b %Y]'
  7.     __author__ = 'Oliver Niesner'
  8.     no_stylesheets = True
  9.     oldest_article = 14
  10.     max_articles_per_feed = 100
  11.     use_embedded_content = False
  12.     filter_regexps = [r'feedads\.googleadservices\.com']
  13.     filter_regexps = [r'ad\.doubleclick']
  14.     filter_regexps = [r'advert']
  15.     language = 'en'
  16.  
  17.     extra_css = 'div {text-align:left}'
  18.     
  19.     remove_tags = [dict(id='topBannerContainer'),
  20.                    dict(id='topBannerSmall'),
  21.                    dict(id='topSearchBar'),
  22.                    dict(id='topSearchForm'),
  23.                    dict(id='rtBannerMPU'),
  24.                    dict(id='topNavBar'),
  25.                    dict(id='breadcrumbs'),
  26.                    #dict(id='entry-28272'),
  27.                    dict(id='topSearchLinks'),
  28.                    dict(name='span', attrs={'class':'date'})]
  29.     
  30.     remove_tags_after = [dict(id='googlemp')]
  31.     
  32.     feeds          = [(u'securitywatch', u'http://feeds.ziffdavisenterprise.com/RSS/security_watch/')]
  33.  
  34.  
  35.     def postprocess_html(self, soup, first_fetch):
  36.         for t in soup.findAll(['table', 'tr', 'td']):
  37.             t.name = 'div'
  38.         return soup
  39.