mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update MIT Technology Review
This commit is contained in:
parent
7947010d73
commit
2c8afa639c
@ -43,6 +43,7 @@ class MitTechnologyReview(BasicNewsRecipe):
|
|||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
remove_attributes = ['height', 'width', 'style', 'padding', 'padding-top']
|
remove_attributes = ['height', 'width', 'style', 'padding', 'padding-top']
|
||||||
|
delay = 1
|
||||||
masthead_url = 'https://wp-preprod.technologyreview.com/wp-content/uploads/2021/08/Screen-Shot-2021-08-20-at-11.11.12-AM-e1629473232355.png'
|
masthead_url = 'https://wp-preprod.technologyreview.com/wp-content/uploads/2021/08/Screen-Shot-2021-08-20-at-11.11.12-AM-e1629473232355.png'
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
#pub-d{font-size:small;}
|
#pub-d{font-size:small;}
|
||||||
@ -69,21 +70,16 @@ class MitTechnologyReview(BasicNewsRecipe):
|
|||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
soup = self.index_to_soup(self.INDEX)
|
soup = self.index_to_soup(self.INDEX)
|
||||||
self.timefmt = ' [{}]'.format(
|
issue = soup.find('h1', attrs={'class':lambda x: x and x.startswith('magazineHero__title')})
|
||||||
self.tag_to_string(
|
time = soup.find(attrs={'class': lambda x: x and x.startswith('magazineHero__date')})
|
||||||
soup.find(
|
self.timefmt = ' (' + self.tag_to_string(issue) + ') [' + self.tag_to_string(time) + ']'
|
||||||
attrs={
|
self.log('Downloading issue: ', self.timefmt)
|
||||||
'class': lambda x: x and x.startswith('magazineHero__date')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# parse articles
|
# parse articles
|
||||||
feeds = OrderedDict()
|
feeds = OrderedDict()
|
||||||
|
|
||||||
classNamePrefixes = [
|
classNamePrefixes = [
|
||||||
"magazineHero__letter--", "teaserItem__title", "teaserItem--aside__title"
|
"teaserItem__title", "teaserItem--aside__title"
|
||||||
]
|
]
|
||||||
for div in soup.findAll(
|
for div in soup.findAll(
|
||||||
attrs={
|
attrs={
|
||||||
|
Loading…
x
Reference in New Issue
Block a user