mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Merge pull request #18 from rsdy/master
highlight different search results differently
This commit is contained in:
commit
6f8daea724
5 changed files with 24 additions and 11 deletions
|
|
@ -13,9 +13,10 @@ def response(resp):
|
|||
results = []
|
||||
if 'Definition' in search_res:
|
||||
if search_res.get('AbstractURL'):
|
||||
res = {'title' : search_res.get('Heading', '')
|
||||
,'content' : search_res.get('Definition', '')
|
||||
,'url' : search_res.get('AbstractURL', '')
|
||||
res = {'title' : search_res.get('Heading', '')
|
||||
,'content' : search_res.get('Definition', '')
|
||||
,'url' : search_res.get('AbstractURL', '')
|
||||
,'class' : 'definition_result'
|
||||
}
|
||||
results.append(res)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ def response(resp):
|
|||
title = ' '.join(link.xpath('.//text()'))
|
||||
content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()')))
|
||||
seed, leech = result.xpath('.//td[@align="right"]/text()')[:2]
|
||||
content += '<br />Seed: %s, Leech: %s' % (seed, leech)
|
||||
magnetlink = result.xpath('.//a[@title="Download this torrent using magnet"]')[0]
|
||||
content += '<br /><a href="%s">magnet link</a>' % urljoin(url, magnetlink.attrib['href'])
|
||||
results.append({'url': href, 'title': title, 'content': content})
|
||||
results.append({'url': href, 'title': title, 'content': content,
|
||||
'seed': seed, 'leech': leech, 'magnetlink': magnetlink.attrib['href'],
|
||||
'template': 'torrent.html'})
|
||||
return results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue