|
@@ -48,19 +48,6 @@ favicons = ['wikipedia', 'youtube', 'vimeo', 'soundcloud',
|
48
|
48
|
'twitter', 'stackoverflow', 'github']
|
49
|
49
|
|
50
|
50
|
|
51
|
|
-opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
|
52
|
|
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
53
|
|
- <ShortName>searx</ShortName>
|
54
|
|
- <Description>Search searx</Description>
|
55
|
|
- <InputEncoding>UTF-8</InputEncoding>
|
56
|
|
- <LongName>searx meta search engine</LongName>
|
57
|
|
- <Url type="text/html" method="{method}" template="{host}">
|
58
|
|
- <Param name="q" value="{{searchTerms}}" />
|
59
|
|
- </Url>
|
60
|
|
-</OpenSearchDescription>
|
61
|
|
-'''
|
62
|
|
-
|
63
|
|
-
|
64
|
51
|
@babel.localeselector
|
65
|
52
|
def get_locale():
|
66
|
53
|
locale = request.accept_languages.best_match(settings['locales'].keys())
|
|
@@ -298,13 +285,11 @@ Disallow: /engines
|
298
|
285
|
|
299
|
286
|
@app.route('/opensearch.xml', methods=['GET'])
|
300
|
287
|
def opensearch():
|
301
|
|
- global opensearch_xml
|
302
|
288
|
method = 'post'
|
303
|
289
|
# chrome/chromium only supports HTTP GET....
|
304
|
290
|
if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
|
305
|
291
|
method = 'get'
|
306
|
|
- base_url = get_base_url()
|
307
|
|
- ret = opensearch_xml.format(method=method, host=base_url)
|
|
292
|
+ ret = render('opensearch.xml', method=method, host=get_base_url())
|
308
|
293
|
resp = Response(response=ret,
|
309
|
294
|
status=200,
|
310
|
295
|
mimetype="application/xml")
|