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

  1. import re
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class AdvancedUserRecipe1302341394(BasicNewsRecipe):
  5.     title          = u'DvhN'
  6.     __author__ = 'Reijndert'
  7.     oldest_article = 7
  8.     max_articles_per_feed = 200
  9.  
  10.     no_stylesheets = True
  11.     cover_url = 'http://members.home.nl/apm.de.haas/calibre/DvhN.jpg'
  12.     language = 'nl'
  13.     country = 'NL'
  14.     version = 1
  15.     publisher = u'Dagblad van het Noorden'
  16.     category = u'Nieuws'
  17.     description = u'Nieuws uit Noord Nederland'
  18.     timefmt = ' %Y-%m-%d (%a)'
  19.  
  20.  
  21.     keep_only_tags = [dict(name='div', attrs={'id':'fullPicture'})
  22.                                ,dict(name='div', attrs={'id':'articleText'})
  23.                   ]
  24.  
  25.     remove_tags = [
  26.                     dict(name='span',attrs={'class':'location'})
  27.                 ]
  28.  
  29.     preprocess_regexps = [
  30.         (re.compile(r'<a.*?>'), lambda h1: '')
  31.        ,(re.compile(r'</a>'), lambda h2: '')
  32.        ,(re.compile(r'Word vriend van Dagblad van het Noorden op Facebook'), lambda h3: '')
  33.        ,(re.compile(r'Volg Dagblad van het Noorden op Twitter'), lambda h3: '')
  34.      ]
  35.  
  36.  
  37.     feeds          = [(u'Drenthe', u'http://www.dvhn.nl/nieuws/drenthe/index.jsp?service=rss')
  38.     , (u'Groningen', u'http://www.dvhn.nl/nieuws/groningen/index.jsp?service=rss')
  39.     , (u'Nederland', u'http://www.dvhn.nl/nieuws/nederland/index.jsp?service=rss')
  40.     , (u'Wereld', u'http://www.dvhn.nl/nieuws/wereld/index.jsp?service=rss')
  41.     , (u'Economie', u'http://www.dvhn.nl/nieuws/economie/index.jsp?service=rss')
  42.     , (u'Sport', u'http://www.dvhn.nl/nieuws/sport/index.jsp?service=rss')
  43.     , (u'Cultuur', u'http://www.dvhn.nl/nieuws/kunst/index.jsp?service=rss')
  44.     , (u'24 Uur', u'http://www.dvhn.nl/nieuws/24uurdvhn/index.jsp?service=rss&selectiontype=last24hours')
  45.      ]
  46.  
  47.     extra_css = '''
  48.                 body {font-family: verdana, arial, helvetica, geneva, sans-serif;}
  49.                 '''
  50.