summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-01-23 23:48:07 -0800
committerAdam Tauber <asciimoo@gmail.com>2014-01-23 23:48:07 -0800
commitf1db60d28f3512186b73ede98f814688513a1e54 (patch)
tree45ba9fb8634d7a079fb1199f406b08306106afcb
parent59eeeaab87951fd6fa3302ec240db98902a20b2c (diff)
parentb82ba74a7dfba4b3b3d54ecfc6f99e02d473f7d1 (diff)
Merge pull request #29 from pw3t/ixquick
Ixquick
-rw-r--r--searx/engines/startpage.py12
-rw-r--r--searx/settings.yml7
-rw-r--r--searx/settings_robot.yml7
3 files changed, 22 insertions, 4 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index d6d7cf44d..5a6c570d1 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -1,9 +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):
global search_url
@@ -24,6 +23,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.yml b/searx/settings.yml
index c207f3f57..4978e9b6a 100644
--- a/searx/settings.yml
+++ b/searx/settings.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
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