mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Wired Daily
This commit is contained in:
parent
27928aad75
commit
d3586a79a9
@ -7,6 +7,12 @@ www.wired.com
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
|
def classes(classes):
|
||||||
|
q = frozenset(classes.split(' '))
|
||||||
|
return dict(attrs={
|
||||||
|
'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||||
|
|
||||||
|
|
||||||
class WiredDailyNews(BasicNewsRecipe):
|
class WiredDailyNews(BasicNewsRecipe):
|
||||||
title = 'Wired Daily Edition'
|
title = 'Wired Daily Edition'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
@ -34,12 +40,12 @@ class WiredDailyNews(BasicNewsRecipe):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
|
classes('related-cne-video-component tags-component podcast_storyboard inset-left-component'),
|
||||||
dict(name=['meta', 'link']),
|
dict(name=['meta', 'link']),
|
||||||
dict(name='div', attrs={'class': 'podcast_storyboard'}),
|
|
||||||
dict(id=['sharing', 'social', 'article-tags', 'sidebar']),
|
dict(id=['sharing', 'social', 'article-tags', 'sidebar']),
|
||||||
]
|
]
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(attrs={'data-js': ['post', 'postHeader']}),
|
dict(name='main', attrs={'class': lambda x: x and 'article-main-component__content' in x}),
|
||||||
]
|
]
|
||||||
remove_attributes = ['srcset']
|
remove_attributes = ['srcset']
|
||||||
handle_gzip = True
|
handle_gzip = True
|
||||||
@ -59,4 +65,4 @@ class WiredDailyNews(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def get_article_url(self, article):
|
def get_article_url(self, article):
|
||||||
return article.get('guid', None)
|
return article.get('link', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user