Fix #8487 (NRC Handelsblad feed is empty)

This commit is contained in:
Kovid Goyal 2011-02-15 10:56:44 -07:00
parent 73a5003a4c
commit d702402380

View File

@ -21,8 +21,8 @@ class Pagina12(BasicNewsRecipe):
country = 'NL' country = 'NL'
remove_empty_feeds = True remove_empty_feeds = True
masthead_url = 'http://www.nrc.nl/nrc.nl/images/logo_nrc.png' masthead_url = 'http://www.nrc.nl/nrc.nl/images/logo_nrc.png'
extra_css = """ extra_css = """
body{font-family: Georgia,serif } body{font-family: Georgia,serif }
img{margin-bottom: 0.4em; display: block} img{margin-bottom: 0.4em; display: block}
.bijschrift,.sectie{font-size: x-small} .bijschrift,.sectie{font-size: x-small}
.sectie{color: gray} .sectie{color: gray}
@ -38,10 +38,10 @@ class Pagina12(BasicNewsRecipe):
keep_only_tags = [dict(attrs={'class':'uitstekendekeus'})] keep_only_tags = [dict(attrs={'class':'uitstekendekeus'})]
remove_tags = [ remove_tags = [
dict(name=['meta','base','link','object','embed']) dict(name=['meta','base','link','object','embed'])
,dict(attrs={'class':['reclamespace','tags-and-sharing']}) ,dict(attrs={'class':['reclamespace','tags-and-sharing','sharing-is-caring']})
] ]
remove_attributes=['lang'] remove_attributes=['lang']
feeds = [ feeds = [
(u'Voor nieuws', u'http://www.nrc.nl/nieuws/categorie/nieuws/rss.php' ) (u'Voor nieuws', u'http://www.nrc.nl/nieuws/categorie/nieuws/rss.php' )
,(u'Binnenland' , u'http://www.nrc.nl/nieuws/categorie/binnenland/rss.php' ) ,(u'Binnenland' , u'http://www.nrc.nl/nieuws/categorie/binnenland/rss.php' )
@ -69,8 +69,8 @@ class Pagina12(BasicNewsRecipe):
del item[atit] del item[atit]
else: else:
str = self.tag_to_string(item) str = self.tag_to_string(item)
item.replaceWith(str) item.replaceWith(str)
for item in soup.findAll('img'): for item in soup.findAll('img'):
if not item.has_key('alt'): if not item.has_key('alt'):
item['alt'] = 'image' item['alt'] = 'image'
return soup return soup