Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
350a8452
Commit
350a8452
authored
Jul 25, 2016
by
Adam Tauber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] time range detection
parent
3a8d193d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
10 additions
and
7 deletions
+10
-7
deviantart.py
searx/engines/deviantart.py
+1
-2
duckduckgo.py
searx/engines/duckduckgo.py
+1
-1
google.py
searx/engines/google.py
+1
-1
google_images.py
searx/engines/google_images.py
+1
-2
yahoo.py
searx/engines/yahoo.py
+1
-1
test_deviantart.py
tests/unit/engines/test_deviantart.py
+1
-0
test_duckduckgo.py
tests/unit/engines/test_duckduckgo.py
+1
-0
test_google.py
tests/unit/engines/test_google.py
+1
-0
test_google_images.py
tests/unit/engines/test_google_images.py
+1
-0
test_yahoo.py
tests/unit/engines/test_yahoo.py
+1
-0
No files found.
searx/engines/deviantart.py
View file @
350a8452
...
...
@@ -13,7 +13,6 @@
"""
from
urllib
import
urlencode
from
urlparse
import
urljoin
from
lxml
import
html
import
re
from
searx.engines.xpath
import
extract_text
...
...
@@ -39,7 +38,7 @@ def request(query, params):
params
[
'url'
]
=
search_url
.
format
(
offset
=
offset
,
query
=
urlencode
({
'q'
:
query
}))
if
params
[
'time_range'
]:
if
params
[
'time_range'
]
in
time_range_dict
:
params
[
'url'
]
+=
time_range_url
.
format
(
range
=
time_range_dict
[
params
[
'time_range'
]])
return
params
...
...
searx/engines/duckduckgo.py
View file @
350a8452
...
...
@@ -67,7 +67,7 @@ def request(query, params):
params
[
'url'
]
=
url
.
format
(
query
=
urlencode
({
'q'
:
query
}),
offset
=
offset
)
if
params
[
'time_range'
]:
if
params
[
'time_range'
]
in
time_range_dict
:
params
[
'url'
]
+=
time_range_url
.
format
(
range
=
time_range_dict
[
params
[
'time_range'
]])
return
params
...
...
searx/engines/google.py
View file @
350a8452
...
...
@@ -185,7 +185,7 @@ def request(query, params):
query
=
urlencode
({
'q'
:
query
}),
hostname
=
google_hostname
,
lang
=
url_lang
)
if
params
[
'time_range'
]:
if
params
[
'time_range'
]
in
time_range_dict
:
params
[
'url'
]
+=
time_range_search
.
format
(
range
=
time_range_dict
[
params
[
'time_range'
]])
params
[
'headers'
][
'Accept-Language'
]
=
language
...
...
searx/engines/google_images.py
View file @
350a8452
...
...
@@ -11,7 +11,6 @@
"""
from
urllib
import
urlencode
from
urlparse
import
parse_qs
from
json
import
loads
from
lxml
import
html
...
...
@@ -39,7 +38,7 @@ def request(query, params):
params
[
'url'
]
=
search_url
.
format
(
query
=
urlencode
({
'q'
:
query
}),
offset
=
offset
,
safesearch
=
safesearch
)
if
params
[
'time_range'
]:
if
params
[
'time_range'
]
in
time_range_dict
:
params
[
'url'
]
+=
time_range_search
.
format
(
range
=
time_range_dict
[
params
[
'time_range'
]])
if
safesearch
and
params
[
'safesearch'
]:
...
...
searx/engines/yahoo.py
View file @
350a8452
...
...
@@ -58,7 +58,7 @@ def parse_url(url_string):
def
_get_url
(
query
,
offset
,
language
,
time_range
):
if
time_range
:
if
time_range
in
time_range_dict
:
return
base_url
+
search_url_with_time
.
format
(
offset
=
offset
,
query
=
urlencode
({
'p'
:
query
}),
lang
=
language
,
...
...
tests/unit/engines/test_deviantart.py
View file @
350a8452
...
...
@@ -10,6 +10,7 @@ class TestDeviantartEngine(SearxTestCase):
query
=
'test_query'
dicto
=
defaultdict
(
dict
)
dicto
[
'pageno'
]
=
0
dicto
[
'time_range'
]
=
''
params
=
deviantart
.
request
(
query
,
dicto
)
self
.
assertTrue
(
'url'
in
params
)
self
.
assertTrue
(
query
in
params
[
'url'
])
...
...
tests/unit/engines/test_duckduckgo.py
View file @
350a8452
...
...
@@ -12,6 +12,7 @@ class TestDuckduckgoEngine(SearxTestCase):
dicto
=
defaultdict
(
dict
)
dicto
[
'pageno'
]
=
1
dicto
[
'language'
]
=
'de_CH'
dicto
[
'time_range'
]
=
''
params
=
duckduckgo
.
request
(
query
,
dicto
)
self
.
assertIn
(
'url'
,
params
)
self
.
assertIn
(
query
,
params
[
'url'
])
...
...
tests/unit/engines/test_google.py
View file @
350a8452
...
...
@@ -19,6 +19,7 @@ class TestGoogleEngine(SearxTestCase):
dicto
=
defaultdict
(
dict
)
dicto
[
'pageno'
]
=
1
dicto
[
'language'
]
=
'fr_FR'
dicto
[
'time_range'
]
=
''
params
=
google
.
request
(
query
,
dicto
)
self
.
assertIn
(
'url'
,
params
)
self
.
assertIn
(
query
,
params
[
'url'
])
...
...
tests/unit/engines/test_google_images.py
View file @
350a8452
...
...
@@ -11,6 +11,7 @@ class TestGoogleImagesEngine(SearxTestCase):
dicto
=
defaultdict
(
dict
)
dicto
[
'pageno'
]
=
1
dicto
[
'safesearch'
]
=
1
dicto
[
'time_range'
]
=
''
params
=
google_images
.
request
(
query
,
dicto
)
self
.
assertIn
(
'url'
,
params
)
self
.
assertIn
(
query
,
params
[
'url'
])
...
...
tests/unit/engines/test_yahoo.py
View file @
350a8452
...
...
@@ -28,6 +28,7 @@ class TestYahooEngine(SearxTestCase):
query
=
'test_query'
dicto
=
defaultdict
(
dict
)
dicto
[
'pageno'
]
=
1
dicto
[
'time_range'
]
=
''
dicto
[
'language'
]
=
'fr_FR'
params
=
yahoo
.
request
(
query
,
dicto
)
self
.
assertIn
(
'url'
,
params
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment