mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1459 (Recipe: slight improvement to Hindu)
This commit is contained in:
parent
9904f33941
commit
ff01e16610
@ -1,10 +1,12 @@
|
||||
from __future__ import with_statement
|
||||
__license__ = 'GPL 3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2009, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
import string
|
||||
|
||||
from calibre import entity_to_unicode
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def classes(classes):
|
||||
q = frozenset(classes.split(' '))
|
||||
@ -67,6 +69,7 @@ class TheHindu(BasicNewsRecipe):
|
||||
try:
|
||||
desc = soup.find('meta', attrs={'name': 'description'}).get('content')
|
||||
if not desc.startswith('Todays paper'):
|
||||
desc = entity_to_unicode(desc)
|
||||
desc += '...' if len(desc) >= 199 else '' # indicate truncation
|
||||
article.text_summary = article.summary = desc
|
||||
except AttributeError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user