mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update NYTimes Tech Beat
This commit is contained in:
parent
ff4c19956f
commit
287fa218aa
@ -9,6 +9,13 @@ __docformat__ = 'restructuredtext en'
|
|||||||
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 NYTimesTechnology(BasicNewsRecipe):
|
class NYTimesTechnology(BasicNewsRecipe):
|
||||||
title = 'New York Times Technology Beat'
|
title = 'New York Times Technology Beat'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
@ -20,30 +27,13 @@ class NYTimesTechnology(BasicNewsRecipe):
|
|||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
language = 'en'
|
language = 'en'
|
||||||
cover_url = 'http://bit.ly/g0SKJT'
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Bits', u'http://bits.blogs.nytimes.com/feed/'),
|
(u'Gadgetwise', u'http://gadgetwise.blogs.nytimes.com/feed/'),
|
||||||
(u'Gadgetwise', u'http://gadgetwise.blogs.nytimes.com/feed/'),
|
|
||||||
(u'Open', u'http://open.blogs.nytimes.com/feed/')
|
|
||||||
]
|
]
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'id': ['story-body', 'header', 'story-meta']}),
|
|
||||||
dict(name='h1'),
|
dict(name='h1'),
|
||||||
dict(name='h2'),
|
classes('extended-byline story-body'),
|
||||||
dict(name='div', attrs={'class': 'entry-content'})
|
|
||||||
]
|
]
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(id='lede-ad'),
|
classes('visually-hidden newsletter-signup nocontent robots-nocontent hidden'),
|
||||||
dict(attrs={'class': lambda x: x and 'ad' in x.split()}),
|
|
||||||
dict(attrs={'class': lambda x: x and 'nocontent' in x.split()}),
|
|
||||||
]
|
]
|
||||||
extra_css = '''
|
|
||||||
h1{font-family:Arial,Helvetica,sans-serif;
|
|
||||||
font-weight:bold;font-size:large;}
|
|
||||||
|
|
||||||
h2{font-family:Arial,Helvetica,sans-serif;
|
|
||||||
font-weight:normal;font-size:small;}
|
|
||||||
|
|
||||||
p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
|
|
||||||
body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
|
|
||||||
'''
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user