X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=47bd8c621ae8ec5308aa91b84f9e69ff5a523e56;hp=107cff32ead789f34c333b62d2c6910ba6c3c2e4;hb=refs%2Fheads%2Fmaster;hpb=efd7e92fc2f52dc157359b99f471be8b8defeeda
diff --git a/index.php b/index.php
index 107cff3..6314d36 100644
--- a/index.php
+++ b/index.php
@@ -11,26 +11,35 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.
*/
-$dse = "";
+$consearch_name = "consearch";
+$consearch_base_url = "https://fpunktk.de/consearch/";
+$consearch_url = "$consearch_base_url" . "index.php";
+
+$dse = ""; // default search engine
if ( isset($_GET['dse']) and preg_match('/^[0-9a-z]{1,5}$/', $_GET['dse']) === 1 ) { // TODO: prevent injection, check whether dse is a valid searchengine
$dse = $_GET['dse'];
}
+$browserintegration = "";
+if ( isset($_GET['include']) and $_GET['include'] == "browserintegration" ) {
+ $browserintegration = "true";
+}
if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) {
+ header('Content-Type: text/xml');
echo '
-consearch';
+' . "$consearch_name";
if ( $dse ) { echo " ($dse)"; }
echo 'conveniently use different searchenginesconsearchconsearch @ f p u n k t k . de
-
-https://www.fpunktk.de/consearch/consearch.png
-';
-
+ echo '#{searchTerms}">
+' . "$consearch_base_url" . 'consearch.png
+
+';
exit;
}
@@ -41,15 +50,16 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) {
-
In firefox desktop this is done via the search bar or the â¯-button in the address bar.
+
In firefox for android: Go to settings â search â add search engine â other, add a name (like $consearch_name) and the url '$consearch_url#%s'
+
+ If this does not work then $consearch_name can perhaps be added via the following form (right-click the input and select 'Add a Keyword for this Search...'), but this will send all queries to the server and is therefore not recommended.
+
+