mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update theonion.recipe
fix to get articles after the website redesign
This commit is contained in:
parent
8743b06b30
commit
d5216c9e10
@ -22,6 +22,7 @@ class TheOnion(BasicNewsRecipe):
|
|||||||
publication_type = 'newsportal'
|
publication_type = 'newsportal'
|
||||||
needs_subscription = 'optional'
|
needs_subscription = 'optional'
|
||||||
masthead_url = 'http://www.theonion.com/static/onion/img/logo_1x.png'
|
masthead_url = 'http://www.theonion.com/static/onion/img/logo_1x.png'
|
||||||
|
cover_url = 'http://www.theonion.com/static/onion/img/logo_1x.png'
|
||||||
extra_css = """
|
extra_css = """
|
||||||
body{font-family: Helvetica,Arial,sans-serif}
|
body{font-family: Helvetica,Arial,sans-serif}
|
||||||
.section_title{color: gray; text-transform: uppercase}
|
.section_title{color: gray; text-transform: uppercase}
|
||||||
@ -38,11 +39,13 @@ class TheOnion(BasicNewsRecipe):
|
|||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(attrs={'class':'full-article'})]
|
keep_only_tags = [dict(attrs={'class':lambda x: x and 'content-wrapper' in x.split()})]
|
||||||
remove_attributes = ['lang','rel']
|
remove_attributes = ['lang','rel']
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name=['object','link','iframe','base','meta'])
|
dict(name=['object','link','iframe','base','meta','button','footer','blockquote','figcaption'])
|
||||||
,dict(attrs={'class':lambda x: x and 'share-tools' in x.split()})
|
,dict(attrs={'class':lambda x: x and 'share-tools' in x.split()})
|
||||||
|
,dict(attrs={'class':lambda x: x and 'content-meta' in x.split()})
|
||||||
|
,dict(attrs={'class':'below-article-tools'})
|
||||||
,dict(name='div', attrs={'id':['topshare', 'bottomshare']})
|
,dict(name='div', attrs={'id':['topshare', 'bottomshare']})
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user