diff --git a/recipes/toiprint.recipe b/recipes/toiprint.recipe index 316f28a1ea..71883fd02b 100644 --- a/recipes/toiprint.recipe +++ b/recipes/toiprint.recipe @@ -29,6 +29,7 @@ class toiprint(BasicNewsRecipe): masthead_url = 'https://static.toiimg.com/photo/98333929.cms' timefmt = ' [' + dt.strftime('%b %d, %Y') + ']' description = 'Articles from the Times of India epaper, digital edition' + encoding = 'utf-8' def __init__(self, *args, **kwargs): BasicNewsRecipe.__init__(self, *args, **kwargs) @@ -37,7 +38,7 @@ class toiprint(BasicNewsRecipe): extra_css = ''' .sub { color:#5c5c5c; } - .auth { font-size:small; } + .auth { font-size:small; font-weight:bold; color:#202020; } .cap { text-align:center; font-size:small; } img { display:block; margin:0 auto; } ''' @@ -72,7 +73,10 @@ class toiprint(BasicNewsRecipe): page = link.split('_')[-3] url = page + '-' + link title = art.get('ArticleTitle', 'unknown') - desc = 'Page No.' + page + ' | ' + art.get('ColumnTitle', '') + if art.get('ColumnTitle', '') == '': + desc = 'Page No.' + page + ' | ' + art.get('ArticleBody', '') + else: + desc = 'Page No.' + page + ' | ' + art.get('ColumnTitle', '') self.log('\t', title, '\n\t', desc, '\n\t\t', url) articles.append({'title': title, 'description':desc, 'url': url}) if articles: @@ -88,18 +92,18 @@ class toiprint(BasicNewsRecipe): if x['TagName'] == 'ColumnTitle': body += '
' + x['ZoneText'] + '
' if x['TagName'] == 'Author': - body += '' + x['ZoneText'].replace('
', '') + '
' + x['ZoneText'].replace('
', '') + '
' + x['ZoneText'] + '
' + if x['TagName'] in {'LinkTo', 'LinkFrom'}: + body += '' + x['ZoneText'] + '
' if x['TagName'] == 'Photographs': pag = x['ZoneID'].split('_')[-4] body += '' - return '
') + '
').replace('
', '
') + '