Debian Codegraph @

recipes/uninohimitu.recipe

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