1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-20 03:10:10 +01:00

[ehn] added ixquick engine, using startpage engine

This commit is contained in:
pw3t 2014-01-19 21:20:07 +01:00
parent d6b017efb5
commit 1dd35e9916
2 changed files with 15 additions and 3 deletions

View File

@ -3,8 +3,8 @@ from lxml import html
from urlparse import urlparse from urlparse import urlparse
from cgi import escape from cgi import escape
base_url = 'https://startpage.com/' base_url = None
search_url = base_url+'do/search' search_url = None
def request(query, params): def request(query, params):
global search_url global search_url
@ -26,6 +26,11 @@ def response(resp):
url = link.attrib.get('href') url = link.attrib.get('href')
parsed_url = urlparse(url) parsed_url = urlparse(url)
title = link.text_content() title = link.text_content()
content = result.xpath('./p[@class="desc"]')[0].text_content()
content =''
if len(result.xpath('./p[@class="desc"]')):
content = result.xpath('./p[@class="desc"]')[0].text_content()
results.append({'url': url, 'title': title, 'content': content}) results.append({'url': url, 'title': title, 'content': content})
return results return results

View File

@ -68,6 +68,13 @@ engines:
- name : startpage - name : startpage
engine : startpage engine : startpage
base_url : 'https://startpage.com/'
search_url : 'https://startpage.com/do/search'
- name : ixquick
engine : startpage
base_url : 'https://www.ixquick.com/'
search_url : 'https://www.ixquick.com/do/search'
- name : twitter - name : twitter
engine : twitter engine : twitter