From e3df22b1401742ae0ade324ce4403f2b2b45dfe1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 11 Sep 2015 17:57:09 +0200 Subject: [fix] handle missing url scheme - fixes #428 --- searx/engines/gigablast.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'searx/engines/gigablast.py') diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index b852de9ba..04513cc98 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -53,6 +53,8 @@ def response(resp): # parse results for result in dom.xpath(results_xpath): url = result.xpath(url_xpath)[0].text + if not url.startswith('http://') and not url.startswith('https://'): + url = 'http://' + url title = result.xpath(title_xpath)[0].text content = escape(result.xpath(content_xpath)[0].text) -- cgit v1.2.3 From 37c3ace3096d9568f8dbdc3728659f4c77377b33 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 11 Sep 2015 18:33:06 +0200 Subject: [fix] add missing scheme to duplicated results too ++ revert gigablasts handling --- searx/engines/gigablast.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'searx/engines/gigablast.py') diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index 04513cc98..b852de9ba 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -53,8 +53,6 @@ def response(resp): # parse results for result in dom.xpath(results_xpath): url = result.xpath(url_xpath)[0].text - if not url.startswith('http://') and not url.startswith('https://'): - url = 'http://' + url title = result.xpath(title_xpath)[0].text content = escape(result.xpath(content_xpath)[0].text) -- cgit v1.2.3 From f1ac794a0737c76516cf6c324027f2dd718a67a1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 16 Oct 2015 12:05:50 +0200 Subject: [fix] gigablast url params --- searx/engines/gigablast.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'searx/engines/gigablast.py') diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index b852de9ba..cfc8e7159 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -13,6 +13,8 @@ from urllib import urlencode from cgi import escape from lxml import etree +from random import randint +from time import time # engine dependent config categories = ['general'] @@ -21,7 +23,7 @@ number_of_results = 5 # search-url, invalid HTTPS certificate base_url = 'http://gigablast.com/' -search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0' +search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0&uxid={uxid}&rand={rand}' # specific xpath variables results_xpath = '//response//result' @@ -37,7 +39,9 @@ def request(query, params): search_path = search_string.format( query=urlencode({'q': query}), offset=offset, - number_of_results=number_of_results) + number_of_results=number_of_results, + uxid=randint(10000, 10000000), + rand=int(time())) params['url'] = base_url + search_path -- cgit v1.2.3