logo

searx

My custom branche(s) on searx, a meta-search engine
commit: 174daf703b341455c3320b61034cdb74bee9b55d
parent: a2bbf027749a69c0b128de2d52cb288fd6bc4f50
Author: asciimoo <asciimoo@gmail.com>
Date:   Sun, 20 Oct 2013 22:37:55 +0200

[enh] chrome opensearch support

Diffstat:

Msearx/static/css/style.css5+++--
Msearx/templates/base.html2+-
Msearx/templates/search.html2+-
Msearx/webapp.py7+++++--
4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/searx/static/css/style.css b/searx/static/css/style.css @@ -12,7 +12,7 @@ input { border: 2px solid #666666; color: #444444; padding: 8px; background-col input[type="checkbox"] { visibility: hidden; } -.checkbox_container { display: inline-block; position: relative; margin: 0; padding-left: 3px; margin: 0 10px; } +.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; } .checkbox_container label { cursor: pointer; } @@ -53,8 +53,9 @@ input[type="checkbox"] { visibility: hidden; } a { text-decoration: none; } -.result_title { margin-bottom: 0; } +.result { margin-bottom: 16px; } +.result_title { margin-bottom: 0; } .result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; } .result h3 { font-size: 0.9em;} .result { max-width: 70em; } diff --git a/searx/templates/base.html b/searx/templates/base.html @@ -3,7 +3,7 @@ <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="en" /> - <meta name="description" content="Searx - a hackable metasearch engine respecting privacy" /> + <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" /> <meta name="keywords" content="searx, search, search engine, metasearch, meta search" /> <title>searx {% block title %}{% endblock %}</title> <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" charset="utf-8" /> diff --git a/searx/templates/search.html b/searx/templates/search.html @@ -1,4 +1,4 @@ -<form method="post" action=""> +<form method="post" action="/"> <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/> <input type="submit" value="search" /> <p> diff --git a/searx/webapp.py b/searx/webapp.py @@ -37,7 +37,7 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?> <Description>Search searx</Description> <InputEncoding>UTF-8</InputEncoding> <LongName>searx meta search engine</LongName> - <Url type="text/html" method="post" template="{host}"> + <Url type="text/html" method="{method}" template="{host}"> <Param name="q" value="{{searchTerms}}" /> </Url> </OpenSearchDescription> @@ -105,7 +105,10 @@ def fav(): @app.route('/opensearch.xml', methods=['GET']) def opensearch(): global opensearch_xml - ret = opensearch_xml.format(host=url_for('index', _external=True)) + method = 'post' + if request.headers.get('User-Agent', '').lower().find('webkit') >= 0: + method = 'get' + ret = opensearch_xml.format(method=method, host=url_for('index', _external=True)) resp = Response(response=ret, status=200, mimetype="application/xml")