diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2016-07-26 00:06:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-26 00:06:16 +0200 |
| commit | 7d9c898170df497036b8a7a70a1a5c86c3859670 (patch) | |
| tree | ca1722a5d0d1bc8493e50bd334a07ea50e744e63 /searx/engines/deviantart.py | |
| parent | 54d987636e4b03d19a99ad9d143bf63b119af208 (diff) | |
| parent | 90e74fbb288b2f1df0516d877d3bd239c7800412 (diff) | |
Merge pull request #634 from kvch/advanced-search
support time range search
Diffstat (limited to 'searx/engines/deviantart.py')
| -rw-r--r-- | searx/engines/deviantart.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py index 70761370c..ef1dd9e5f 100644 --- a/searx/engines/deviantart.py +++ b/searx/engines/deviantart.py @@ -21,10 +21,16 @@ from searx.engines.xpath import extract_text # engine dependent config categories = ['images'] paging = True +time_range_support = True # search-url base_url = 'https://www.deviantart.com/' search_url = base_url + 'browse/all/?offset={offset}&{query}' +time_range_url = '&order={range}' + +time_range_dict = {'day': 11, + 'week': 14, + 'month': 15} # do search-request @@ -33,6 +39,8 @@ def request(query, params): params['url'] = search_url.format(offset=offset, query=urlencode({'q': query})) + if params['time_range']: + params['url'] += time_range_url.format(range=time_range_dict[params['time_range']]) return params |