Update The Economic Times India Print Edition

This commit is contained in:
Kovid Goyal 2022-10-11 14:30:20 +05:30
parent 9cfeb668f1
commit 0f5b509c75
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,3 +1,4 @@
''' '''
economictimes.indiatimes.com economictimes.indiatimes.com
''' '''
@ -19,13 +20,28 @@ class TheEconomicTimes(BasicNewsRecipe):
remove_attributes = ['style', 'height', 'width'] remove_attributes = ['style', 'height', 'width']
publication_type = 'newspaper' publication_type = 'newspaper'
masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/9/98/The_Economic_Times_logo.svg' masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/9/98/The_Economic_Times_logo.svg'
cover_url = 'https://www.readwhere.com/read/imageapi/coverforissue/3034969/magazine/600'
ignore_duplicate_articles = {'title', 'url'} ignore_duplicate_articles = {'title', 'url'}
extra_css = ''' extra_css = '''
.summary {font-weight:normal; font-size:normal; font-style:italic;} .summary {font-weight:normal; font-size:normal; font-style:italic;}
time{font-size:small;} time{font-size:small;}
''' '''
def get_cover_url(self):
from datetime import date
yr = str(date.today().year)
mn = date.today().strftime('%m')
dy = date.today().strftime('%d')
cover = 'https://asset.harnscloud.com/PublicationData/ET/etbg/'\
+ yr + '/' + mn + '/' + dy + '/Page/' + dy + '_' + mn + '_' + yr + '_001_etbg.jpg'
self.log('cover_url ', cover)
br = BasicNewsRecipe.get_browser(self)
try:
br.open(cover)
except:
self.log("\nCover unavailable")
cover = None
return cover
keep_only_tags = [ keep_only_tags = [
dict(name='h1'), dict(name='h1'),
classes( classes(