update images
[consearch.git] / index.php
index 1f3311e..d8cd2f3 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,11 +1,5 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-
-<!--
+<?php
+/*
 consearch
 
 Copyright (C) 2015 Felix K√§stner, consearch @ f p u n k t k . de
@@ -15,11 +9,41 @@ This program is free software; you can redistribute it and/or modify it under th
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
 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 = "";
+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'];
+}
+
+if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) {
+    echo '<?xml version="1.0" encoding="UTF-8"?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+<ShortName>consearch';
+    if ( $dse ) { echo " ($dse)"; }
+    echo '</ShortName>
+<Description>conveniently use different searchengines</Description>
+<Tags>consearch</Tags>
+<Contact>consearch @ f p u n k t k . de</Contact>
+<Url type="text/html" template="https://www.fpunktk.de/consearch/index.php';
+    if ( $dse ) { echo "?dse=$dse"; }
+    echo '#{searchTerms}" />
+<Image height="16" width="16" type="image/png">https://www.fpunktk.de/consearch/consearch.png</Image>
+</OpenSearchDescription>';
+    
+    exit;
+}
+
+?>
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
 <title>consearch</title>
 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAACMuuz63rNKAAAAK0lEQVQI12P4/58BiM4cZ9gdDUVnboNE/n8Hoc6JDLvLGLrLGF4DyWlAcQBYKBgvsgbJOAAAAABJRU5ErkJggg==" type="image/png">
-<link rel="search" type="application/opensearchdescription+xml" href="opensearchdescription-consearch.xml.php" title="consearch">
+<link rel="search" type="application/opensearchdescription+xml" href="index.php?get=opensearchdescription<?php if ( $dse ) { echo "&amp;dse=$dse"; } ?>" title="consearch<?php if ( $dse ) { echo " ($dse)"; } ?>">
 
 <style type="text/css">
 * {
@@ -48,7 +72,9 @@ input {
 }
 button {
     margin: 0px -5px 3mm 0px; /* trbl */
-    padding: -4px;
+    padding: 3px;
+    background: none;
+    border: 1px solid black;
     width: 13ex; /* 13ex 11ch */
     width: 11ch; /* used twice because some browsers don't understand it */
     height: 13mm;
@@ -69,7 +95,7 @@ b64images["gb.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IAr
 b64images["gg.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/gD+AP7rGNSCAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAADCklEQVQ4yyXSy2ucVRjA4d97zvdNJpPJbTJJE9rYaCINShZtRCFIA1bbLryBUlyoLQjqVl12W7UbN4qb1gtuYhFRRBCDBITaesFbbI3RFBLSptEY05l0ZjLfnMvrov/Bs3gAcF71x6VVHTk+o8nDH+hrH89rUK9Z9Yaen57S3wVtGaMBNGC0IegWKIDxTtVaOHVugZVmH3HX3Zz+4l+W1xvkOjuZfPsspY4CNkZELEgEIJKwYlBjEwjec/mfCMVuorVs76R8+P0KYMmP30U2dT8eIZqAR2ipRcWjEYxGSCRhV08e04oYMoxYLi97EI9YCJ0FHBYbIVGDlUBLwRlLIuYW6chEmQt/rJO09RJjhjEJEYv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C/f73So/Mt0EJ1JBKpbFwax3Up7j49gUcfzaEEjVhlvMolcuoKS7aI+24v/bH9tjIa1UhnU5zA8Px0xQGZr76EZmby3DhYeT8EJ4a0FHnm9EiczgSjGDb3AHnmdgz8sbe7t7c+9OXPO6nu4tNwWa5++bndzA7uQDbs/H6m8NInjgGLij5asMBTERhyQ4qngnCc8hv/bUxNjpalCQJfLCxUc3cShsXT8qnZjIFe3D46cfV6mHm04+/+fCTD764vLm6veNSEw71yfL86r3b1xYnv/ss89G777z3sK+vDySXy2H0jfOt8aP8pa0cLdfqdPLcyNkH58bG7P7+fra4uEjm5uaUXC6n9Pb21hOJhJNMJv2uri4AABhjuD41xZ0ZHYudPjsS+jY1TRhj+L//A/A3xA0Fv2p0AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEyLTA5LTA2VDE4OjU2OjM3KzAyOjAwg599jgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMi0wOS0wNlQxODo1NjozNyswMjowMPLCxTIAAAAASUVORK5CYII=";
 b64images["php.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEWAgMDX19cAAAD1ff0gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANElEQVQI12NgQAOiIEISxJB0DGDIipq2lCF1ZlokEpEVmQYUYxELYEhhYHNgCGFgdUBoBwCrTgwE/Pwg0gAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0wNy0xMVQxNzowNTo0NiswMjowMA7uwncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTMtMTAtMjhUMTY6NTY6NTArMDE6MDBB6/VSAAAAAElFTkSuQmCC";
@@ -80,12 +106,15 @@ b64images["wp.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAMFBMVEX8/
 b64images["yt.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAA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P40xP40xP40xP40xP40xP40xP40xPKysr40xOP+DMuAAAAi3RSTlMACAkQERMXGBweLDEzOEBBQkRIS1JTU1dZWV5fYmpuc3WBgoeHkpKXnqKkpKWlrK2ur6+zs7W1tre3t7i5uby8vL29vr6+v7+/v7/AwMLCxMXGx8fIyMnJysvLzMzO0NDR0tLS09PU1tbY2dra293e3t/g4OHh5ejp6erq7O3v7+/x8vT2+Pn6+/z9D21gkgAAAAFiS0dEAIgFHUgAAADOSURBVBjTY2BgYGDhZ0AFqq7iXLIK3AzCPFABxWRtn4QeXzUzHaiAUllXVmJ1UlSGBITP69XZU9qdXlESywwRkHfv6enIrs0s8uCECHCFNPaEFfYARTVEmUACWjFtLrnBleHlad5yIL5QSm6rrZFPZ0RVnnMgB1BA1NHJICfe3s/fLdVBAKRCzCa/Jci8oMaz3E4KbCafcXN7XEeoqZWuIcQSacuGps68np66ehNBsAA7q2aAdXtkcXSHvjLU6RwiFnoqMpLqHAj/sjHCmQCutDB5t6/XDgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wNS0xOFQxNDo1OTowMSswMjowMCdFvu4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDUtMThUMTQ6NTg6MjkrMDI6MDDIECR2AAAAAElFTkSuQmCC";
+
+<?php
 // for f in *.ico; do for q in {0..100}; do convert -quality $q $f ${f%*.ico}$q.png; done; echo "b64images[\"${f%*.ico}.png\"] = \"$(base64 $(\ls -1S ${f%*.ico}*.png | tail -n 1) | tr -d '\n')\";"; done
 // try optipng
 // for f in *.png; do echo "b64images[\"${f}\"] = \"$(base64 $f | tr -d '\n')\";"; done > tmp.js
+?>
 
 var se = new Object(); // object of search engines
 // se["keyword"] = ["displayed name, max 7 chars", "url to which the querystring can be append", "b64images name"];
@@ -111,8 +140,10 @@ se["yt"] = ["youtube", "https://www.youtube.com/results?search_query=", "yt.png"
 se["imdb"] = ["imdb", "http://www.imdb.com/find?s=all&q=", "imdb.png"];
 se["az"] = ["amazon", "https://www.amazon.de/s/?url=search-alias%3Daps&field-keywords=", "az.png"];
 se["php"] = ["php.net", "http://de2.php.net/manual-lookup.php?lang=de&pattern=", "php.png"];
-se["sh"] = ["slfhtml", "http://de.selfhtml.org/navigation/suche/index.htm?Suchanfrage=", "sh.png"];
+se["sh"] = ["slfhtml", "https://wiki.selfhtml.org/index.php?search=", "sh.png"];
 se["down"] = ["down", "http://www.downforeveryoneorjustme.com/", "down.png"];
+se["fefe"] = ["fefe", "https://blog.fefe.de/?q=", ""];
+se["wtr"] = ["wtr.com", "http://www.wetter.com/suche/?o=location&q=", ""];
 
 function display_searchbuttons() {
     document.getElementById("searchbuttons").innerHTML = "";
@@ -128,19 +159,30 @@ function parse_fragmentstring() {
         document.getElementById("querystring").focus();
     } else {
         fragmentarr = fragmentstring.replace("%20", "+").split("+");
-        if ( se[fragmentarr[0]] ) {
-            // first word in query is a keyword
-            kw = fragmentarr[0];
+        kw = fragmentarr[0];
+        if ( se[kw] ) {
+            // first word in query is a search engine keyword
             fragmentarr.shift();
             location.href = se[kw][1] + fragmentarr.join(" ");
         } else {
-            // there is no keyword
-            // display all buttons and write the fragmentstring into the querystring input
-            document.getElementById("querystring").value = fragmentarr.join(" ");
+<?php
+if ( $dse ) {
+    // use a default searchengine
+    echo '            if ( kw != "nd" ) {
+                location.href = se["' . $dse . '"][1] + fragmentarr.join(" ");
+            } else {
+                fragmentarr.shift();
+                document.getElementById("querystring").value = fragmentarr.join(" ");
+                display_searchbuttons();
+            }
+';
+} else {
+    // display all buttons and write the fragmentstring into the querystring input
+    echo '            document.getElementById("querystring").value = fragmentarr.join(" ");
             display_searchbuttons();
-            // or
-            // use a default searchengine
-            //location.href = se["sp"][1] + fragmentarr.join(" ");
+';
+}
+?>
         }
     }
 }