mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #995076 (recipe: mainichi.recipe don't show its article)
This commit is contained in:
parent
f01c91b68f
commit
d54e468053
@ -16,12 +16,12 @@ class MainichiDailyNews(BasicNewsRecipe):
|
|||||||
publisher = 'Mainichi Daily News'
|
publisher = 'Mainichi Daily News'
|
||||||
category = 'news, japan'
|
category = 'news, japan'
|
||||||
language = 'ja'
|
language = 'ja'
|
||||||
|
index = 'http://mainichi.jp/select/'
|
||||||
feeds = [(u'daily news', u'http://mainichi.jp/rss/etc/flash.rss')]
|
remove_javascript = True
|
||||||
|
masthead_title = u'MAINICHI DAILY NEWS'
|
||||||
|
|
||||||
remove_tags_before = {'class':"NewsTitle"}
|
remove_tags_before = {'class':"NewsTitle"}
|
||||||
remove_tags = [{'class':"RelatedArticle"}]
|
remove_tags_after = {'class':"NewsBody clr"}
|
||||||
remove_tags_after = {'class':"Credit"}
|
|
||||||
|
|
||||||
def parse_feeds(self):
|
def parse_feeds(self):
|
||||||
|
|
||||||
@ -32,9 +32,30 @@ class MainichiDailyNews(BasicNewsRecipe):
|
|||||||
for a,curarticle in enumerate(curfeed.articles):
|
for a,curarticle in enumerate(curfeed.articles):
|
||||||
if re.search(r'pheedo.jp', curarticle.url):
|
if re.search(r'pheedo.jp', curarticle.url):
|
||||||
delList.append(curarticle)
|
delList.append(curarticle)
|
||||||
|
if re.search(r'rssad.jp', curarticle.url):
|
||||||
|
delList.append(curarticle)
|
||||||
if len(delList)>0:
|
if len(delList)>0:
|
||||||
for d in delList:
|
for d in delList:
|
||||||
index = curfeed.articles.index(d)
|
index = curfeed.articles.index(d)
|
||||||
curfeed.articles[index:index+1] = []
|
curfeed.articles[index:index+1] = []
|
||||||
|
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
|
def parse_index(self):
|
||||||
|
feeds = []
|
||||||
|
soup = self.index_to_soup(self.index)
|
||||||
|
topstories = soup.find('ul',attrs={'class':'MaiLink'})
|
||||||
|
if topstories:
|
||||||
|
newsarticles = []
|
||||||
|
for itt in topstories.findAll('li'):
|
||||||
|
itema = itt.find('a',href=True)
|
||||||
|
if itema:
|
||||||
|
newsarticles.append({
|
||||||
|
'title' :itema.string
|
||||||
|
,'date' :''
|
||||||
|
,'url' :itema['href']
|
||||||
|
,'description':''
|
||||||
|
})
|
||||||
|
feeds.append(('latest', newsarticles))
|
||||||
|
return feeds
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user