Update MIT Technology Review

This commit is contained in:
Kovid Goyal 2022-11-14 07:56:35 +05:30
parent 7947010d73
commit 2c8afa639c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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={