logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: a8832574fa113e0673dcf9a51ece058b0a4cdcb5
parent 80813c3e056f0831c9e15cff2e94df9dede0a47a
Author: Kirill Isakov <ukwt@ya.ru>
Date:   Sun, 27 Mar 2016 05:09:04 +0600

Shorten content field for very long Reddit search results

Diffstat:

Msearx/engines/reddit.py5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 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)