summaryrefslogtreecommitdiff
path: root/searx/engines/reddit.py
diff options
context:
space:
mode:
authorKirill Isakov <ukwt@ya.ru>2016-03-27 05:09:04 +0600
committerKirill Isakov <ukwt@ya.ru>2016-03-27 05:09:04 +0600
commita8832574fa113e0673dcf9a51ece058b0a4cdcb5 (patch)
tree9441c5d99f5ea89bc00a4600bc4dc42cc0de7836 /searx/engines/reddit.py
parent80813c3e056f0831c9e15cff2e94df9dede0a47a (diff)
downloadsearxng-a8832574fa113e0673dcf9a51ece058b0a4cdcb5.tar.gz
searxng-a8832574fa113e0673dcf9a51ece058b0a4cdcb5.zip
Shorten content field for very long Reddit search results
Diffstat (limited to 'searx/engines/reddit.py')
-rw-r--r--searx/engines/reddit.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/reddit.py b/searx/engines/reddit.py
index d2b185b40..9729898e5 100644
--- a/searx/engines/reddit.py
+++ b/searx/engines/reddit.py
@@ -66,7 +66,10 @@ def response(resp):
img_results.append(params)
else:
created = datetime.fromtimestamp(data['created_utc'])
- params['content'] = escape(data['selftext'])
+ content = escape(data['selftext'])
+ if len(content) > 500:
+ content = content[:500] + '...'
+ params['content'] = content
params['publishedDate'] = created
text_results.append(params)