summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorpw3t <romain@berthor.fr>2014-01-19 21:20:07 +0100
committerpw3t <romain@berthor.fr>2014-01-23 22:14:03 +0100
commita01042ae616524160f32bfbca0e833b1de6dab58 (patch)
tree1bc31a8b246ede9b8f24c30f44a715133fc4265e /searx
parent132681b3aaf5b330d9d19624038b51fe2ebfd8d5 (diff)
downloadsearxng-a01042ae616524160f32bfbca0e833b1de6dab58.tar.gz
searxng-a01042ae616524160f32bfbca0e833b1de6dab58.zip
[ehn] added ixquick engine, using startpage engine
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/startpage.py11
-rw-r--r--searx/settings_robot.yml7
2 files changed, 15 insertions, 3 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index d6d7cf44d..756e1670f 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -1,8 +1,8 @@
from urllib import urlencode
from lxml import html
-base_url = 'https://startpage.com/'
-search_url = base_url+'do/search'
+base_url = None
+search_url = None
def request(query, params):
@@ -24,6 +24,11 @@ def response(resp):
link = result.xpath('.//h3/a')[0]
url = link.attrib.get('href')
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})
+
return results
diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml
index d60ed3272..f7f2fa903 100644
--- a/searx/settings_robot.yml
+++ b/searx/settings_robot.yml
@@ -68,6 +68,13 @@ engines:
- name : 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
engine : twitter