mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
recipe: add dog blog in Japanese
This commit is contained in:
parent
d18bef33e1
commit
c3bbe2cc86
37
resources/recipes/chouchoublog.recipe
Normal file
37
resources/recipes/chouchoublog.recipe
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
|
||||||
|
'''
|
||||||
|
http://ameblo.jp/
|
||||||
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class SakuraBlog(BasicNewsRecipe):
|
||||||
|
title = u'chou chou blog'
|
||||||
|
__author__ = 'Hiroshi Miura'
|
||||||
|
oldest_article = 4
|
||||||
|
publication_type = 'blog'
|
||||||
|
max_articles_per_feed = 20
|
||||||
|
description = 'Japanese popular dog blog'
|
||||||
|
publisher = ''
|
||||||
|
category = 'dog, pet, japan'
|
||||||
|
language = 'ja'
|
||||||
|
encoding = 'utf-8'
|
||||||
|
use_embedded_content = True
|
||||||
|
|
||||||
|
feeds = [(u'blog', u'http://feedblog.ameba.jp/rss/ameblo/chouchou1218/rss20.xml')]
|
||||||
|
|
||||||
|
def parse_feeds(self):
|
||||||
|
feeds = BasicNewsRecipe.parse_feeds(self)
|
||||||
|
for curfeed in feeds:
|
||||||
|
delList = []
|
||||||
|
for a,curarticle in enumerate(curfeed.articles):
|
||||||
|
if re.search(r'rssad.jp', curarticle.url):
|
||||||
|
delList.append(curarticle)
|
||||||
|
if len(delList)>0:
|
||||||
|
for d in delList:
|
||||||
|
index = curfeed.articles.index(d)
|
||||||
|
curfeed.articles[index:index+1] = []
|
||||||
|
return feeds
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user