mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 21:59:22 +02:00
[ehn] Add a 'featured result feature'm putting on top of the reasults ddg definitions and wikipedia (ugly html / css)
[ehn] Add a templates for videos, so the thumbnails all have the same side
This commit is contained in:
parent
ad72c16050
commit
cf8f444e85
6 changed files with 53 additions and 6 deletions
|
@ -26,14 +26,21 @@ def response(resp):
|
|||
url = url[:-1]
|
||||
title = result['title']['$t']
|
||||
content = ''
|
||||
|
||||
thumbnail = ''
|
||||
if len(result['media$group']['media$thumbnail']):
|
||||
content += '<a href="{0}" title="{0}" ><img src="{1}" /></a>'.format(url, result['media$group']['media$thumbnail'][0]['url'])
|
||||
thumbnail = result['media$group']['media$thumbnail'][0]['url']
|
||||
content += '<a href="{0}" title="{0}" ><img src="{1}" /></a>'.format(url, thumbnail)
|
||||
if len(content):
|
||||
content += '<br />' + result['content']['$t']
|
||||
else:
|
||||
content = result['content']['$t']
|
||||
|
||||
results.append({'url': url, 'title': title, 'content': content})
|
||||
results.append({'url': url
|
||||
, 'title': title
|
||||
, 'content': content
|
||||
, 'template':'videos.html'
|
||||
, 'thumbnail':thumbnail})
|
||||
|
||||
return results
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue