mirror of
https://github.com/searxng/searxng.git
synced 2025-08-01 01:22: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
|
@ -35,7 +35,11 @@ def response(resp):
|
|||
for result in dom.xpath(results_xpath):
|
||||
url = base_url + result.xpath(url_xpath)[0]
|
||||
title = p.unescape(extract_text(result.xpath(title_xpath)))
|
||||
content = '<a href="{0}"> <img src="{2}"/> </a>'.format(url, title, extract_text(result.xpath(content_xpath)[0]))
|
||||
results.append({'url': url, 'title': title, 'content': content})
|
||||
|
||||
thumbnail = extract_text(result.xpath(content_xpath)[0])
|
||||
content = '<a href="{0}"> <img src="{2}"/> </a>'.format(url, title, thumbnail)
|
||||
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