1
0
mirror of https://github.com/searx/searx synced 2024-12-11 16:35:20 +01:00

Shorten content field for very long Reddit search results

This commit is contained in:
Kirill Isakov 2016-03-27 05:09:04 +06:00
parent 80813c3e05
commit a8832574fa

View File

@ -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)