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
|
#!/usr/bin/env python
|
||||||
__license__ = 'GPL 3'
|
# vim:fileencoding=utf-8
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
# License: GPLv3 Copyright: 2009, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
from calibre import entity_to_unicode
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
def classes(classes):
|
def classes(classes):
|
||||||
q = frozenset(classes.split(' '))
|
q = frozenset(classes.split(' '))
|
||||||
@ -67,6 +69,7 @@ class TheHindu(BasicNewsRecipe):
|
|||||||
try:
|
try:
|
||||||
desc = soup.find('meta', attrs={'name': 'description'}).get('content')
|
desc = soup.find('meta', attrs={'name': 'description'}).get('content')
|
||||||
if not desc.startswith('Todays paper'):
|
if not desc.startswith('Todays paper'):
|
||||||
|
desc = entity_to_unicode(desc)
|
||||||
desc += '...' if len(desc) >= 199 else '' # indicate truncation
|
desc += '...' if len(desc) >= 199 else '' # indicate truncation
|
||||||
article.text_summary = article.summary = desc
|
article.text_summary = article.summary = desc
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user