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

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