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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
  3. '''
  4. http://ameblo.jp/sauta19/
  5. '''
  6.  
  7. import re
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class UniNoHimituKichiBlog(BasicNewsRecipe):
  11.     title          = u'Uni secret base'
  12.     __author__     = 'Hiroshi Miura'
  13.     oldest_article = 2
  14.     publication_type = 'blog'
  15.     max_articles_per_feed = 20
  16.     description    = 'Japanese famous Cat blog'
  17.     publisher      = ''
  18.     category       = 'cat, pet, japan'
  19.     language       = 'ja'
  20.     encoding      = 'utf-8'
  21.  
  22.     feeds          = [(u'blog', u'http://feedblog.ameba.jp/rss/ameblo/sauta19/rss20.xml')]
  23.  
  24.     def parse_feeds(self):
  25.         feeds = BasicNewsRecipe.parse_feeds(self)
  26.         for curfeed in feeds:
  27.             delList = []
  28.             for a,curarticle in enumerate(curfeed.articles):
  29.                 if re.search(r'rssad.jp', curarticle.url):
  30.                     delList.append(curarticle)
  31.             if len(delList)>0:
  32.                 for d in delList:
  33.                     index = curfeed.articles.index(d)
  34.                     curfeed.articles[index:index+1] = []
  35.         return feeds
  36.  
  37.