add parsing of get variable for default search engine
[consearch.git] / index.php
1 <!DOCTYPE html>
2
3 <!--
4 consearch
5
6 Copyright (C) 2015 Felix K√§stner, consearch @ f p u n k t k . de
7
8 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
9
10 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.
11
12 You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.
13 -->
14
15 <?php
16 $dse = "";
17 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
18     $dse = $_GET['dse'];
19 }
20 ?>
21
22 <html>
23 <head>
24 <meta charset="UTF-8">
25 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
26 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
27 <title>consearch</title>
28 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAACMuuz63rNKAAAAK0lEQVQI12P4/58BiM4cZ9gdDUVnboNE/n8Hoc6JDLvLGLrLGF4DyWlAcQBYKBgvsgbJOAAAAABJRU5ErkJggg==" type="image/png">
29 <link rel="search" type="application/opensearchdescription+xml" href="opensearchdescription-consearch.xml.php<?php if ( $dse ) { echo "?dse=$dse"; } ?>" title="consearch<?php if ( $dse ) { echo " ($dse)"; } ?>">
30
31 <style type="text/css">
32 * {
33     font: 16pt monospace;
34     padding: 0px;
35     margin: 0px;
36 }
37 body {
38     color: #000000;
39     background-color: #8CBAEC;
40     text-align: center;
41     margin: 0ex auto 10mm;
42     padding: 0ex;
43     width: 96%;
44     max-width: 96%;
45 }
46 h1, h1 a {
47     font-size: 12pt;
48     font-weight: bold;
49     margin: 0.4ex;
50 }
51 input {
52     margin-bottom: 3mm;
53     width: 100%;
54     height: 13mm;
55 }
56 button {
57     margin: 0px -5px 3mm 0px; /* trbl */
58     padding: -4px;
59     width: 13ex; /* 13ex 11ch */
60     width: 11ch; /* used twice because some browsers don't understand it */
61     height: 13mm;
62 }
63 img {
64     border: none;
65     margin: 0px;
66     padding: 0px;
67 }
68 </style>
69
70 <script type="text/javascript">
71
72 var b64images = new Object();
73 b64images["az.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAACxklEQVRIx62Vy0/TQRDHf0BpES8gnkAKXjAYSIjhgAeMCf4VeMELBhMvJIAgUEBSD/QPwHjkYeUEJ+ACnuSREB6BXohRoKYQXk1bCGrbrzM7bhb6sPHxuUx/292d787MzlpQOBxiBwfFHh0hDd8VwIECOFYkz4srEkcPD8X294u12y354Xan3sBs8VIBVFbeJYCSklsEUFZWTgD3FMD8/AciebfUx+nr+yUgHE6n/LkCsBRATo6NAIqKbhJAbq7DwfHT43l51wjgkwIZODmx0in9rDCOtW1peUYAXxWA1/ueAGy2XMLMGxsbJ9I5Nn6sdFPOzs4J4I0CaGtrJ4BQKBzmeP1QAJsKoLDwBmEEuN2vCWTESlc8ial4pwAeKoCqqmoCcDrLCE6FnWABWQQwMPCK+AsBiTQ2PibMyex2yXl1tQhoaHhEAPn514nLAph/EDA6OkYk10BXl9wGHaHd3T0CKCgoJP5jBJqbnxJmQy1gYeEjYeYtKDgFughlfnt7B5GpL/xGQEfHC8I4zsrKJoD6+gcER4gBSkudhPlfX8fs7BwC2NuTCP1xBPQ1M7m9mgpty8tvE0Bd3X3CjFdU3CFYgN/P+6TulUpAPB6L8UA0enGR3LO+KExOm5qeEMBbhWnJ3xTA8LBc29PTYDAUkva7uMj7bmz09vJ3MMjXNkUE1ta6u9n91pbHI53A789cRFpwcn5jsWiU7eamNPr1dZeLrc/n8SQ1ItEq7O/PzbGdnOReD8zO1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fV6mHm04+/+fCTD764vLm6veNSEw71yfL86r3b1xYnv/ss89G777z3sK+vDySXy2H0jfOt8aP8pa0cLdfqdPLcyNkH58bG7P7+fra4uEjm5uaUXC6n9Pb21hOJhJNMJv2uri4AABhjuD41xZ0ZHYudPjsS+jY1TRhj+L//A/A3xA0Fv2p0AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEyLTA5LTA2VDE4OjU2OjM3KzAyOjAwg599jgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMi0wOS0wNlQxODo1NjozNyswMjowMPLCxTIAAAAASUVORK5CYII=";
82 b64images["php.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEWAgMDX19cAAAD1ff0gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANElEQVQI12NgQAOiIEISxJB0DGDIipq2lCF1ZlokEpEVmQYUYxELYEhhYHNgCGFgdUBoBwCrTgwE/Pwg0gAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0wNy0xMVQxNzowNTo0NiswMjowMA7uwncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTMtMTAtMjhUMTY6NTY6NTArMDE6MDBB6/VSAAAAAElFTkSuQmCC";
83 b64images["sh.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACXBIWXMAAABIAAAASABGyWs+AAAA+VBMVEU5gqrgrR82f6jfqBw3gqo4gqs4g6s5g6tBiK9Dia9Fi7BGi7FHjLFMj7NTk7Zemrtmn75noL92qcV/r8mAr8mNt86UvNKcwdWewtaixdioyNq10N+60+LJ3ejN4OrS4+zY5+/a6O/fqx7frCDfrCHfrSHgriXhsS3isjHitTjjtjnjtjvjtz3kuUPkukblvErlvU7mvU7mvlDnwVrrynLr8vbs8/ftz3/w9vnx2pzx257x3KHy36jy9/nz4a325772+fv36cT36cX3+vv579T79OL79eP89uf8/f38/f79+vH9/v7++/X+/Pf+/Pj+/fn+/fr+/fv///8t5hX9AAAABHRSTlNaWuDgiHwzrgAAAAFiS0dEUg1gLZAAAACxSURBVBgZPcEHQsJQAAPQ0H6NAxXEvRCCW9xbcRdx4Mj9D2OLlveAiJzuuKd7EBcQheFl564Ug5xz342EQdZsfyfJy9vP54mEMHpm+1brG1t7TUkII6e2k/NmQz3gQNWZr+fL4zVJICvOPWxLIFlZ9b+7usBMaXal5VR3VyADM8UFp44EhuLU5MT42NCMU4cCOW+/P7UuXm1/7Ajkkvse60LERefa+4qBqHzvP9ebigu/AGwyxwJqEuAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDUtMjJUMTg6MTk6NDArMDI6MDCIMpBxAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA1LTIyVDE4OjE5OjIzKzAyOjAwDug71wAAAABJRU5ErkJggg==";
84 b64images["uu.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAIAAADAAbR1AAAABnRSTlMAAAAAAABupgeRAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAMklEQVQ4y2NgwAC/f3d3YyMh4NGj8HBsJAlg1IKBB1eukEOOWkCPOCAmjY1aMGoBLQAAutj8GeaBm/MAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTQtMDctMTFUMTc6MDU6NDcrMDI6MDComcnDAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEzLTEwLTI4VDE2OjU2OjU0KzAxOjAwtaTRQQAAAABJRU5ErkJggg==";
85 b64images["wb.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAIAAADAAbR1AAAABnRSTlMAAAAAAABupgeRAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAiklEQVQ4y2NgIBHMxAsYKAEQI57jBWRag2z0PbzgDBiQbA3NLUC2hiZG449kiAUkG33tWlUVjMRvGcluhxj6///du3Fx//+fOYPbGjITKMwCkNH4LaAIEBNEZIOCgsmTCYlQZPTixSdPwtiYIlQwG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ulfREnTDAXDARGr/vKovgFnyhALlgul0qiz0Zn4hlcArEe808njKldLlerHwlQJ6Tzcn6z2WqFCYwh4Hu8KiD8DlkIYCNUwfj5fLEQ468EYr0XAosJHI/pNP1xMItxJiP6tpblqfkYy7wggAKh6Odmf7vt1gd93wGWV/JQKq7UWwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0wNy0xMVQxNzowNTo0NyswMjowMKiZycMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTMtMTAtMjhUMTY6NTY6NTYrMDE6MDAiO8BoAAAAAElFTkSuQmCC";
88 b64images["imdb.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAaVBMVEUAAAC6pB303yPx3CPu1yPq0yPmziPiyCPfxSPcwCN4bREAAACplBoQDgKUgxczLAjXvSLCrh5tYBF0aREjHwVYTA5qWxFbUA6RfxeulB1xZBGhixq5oh4OCwLUtiPRsyLNrSLGpCKLexYQiDEbAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAASAAAAEgARslrPgAAAHFJREFUGBkFwTFSAzEAADGtbXAITApK/v9AOhguuSABACgAwBJJIn+LRCJpJIkk61LP8ftqPqyOcw84P6D7sI03jDnwwMtzwP7ZYOk+YJquNqaxcTjwDhZcx4nvNS1dZLuR0PjKdlOiWrYbiWD5BAD+AWj2ERU8QW3TAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTA3LTExVDE3OjA3OjM0KzAyOjAwl0EKegAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0wNy0xMVQxNzowNjozOSswMjowMGgJuDgAAAAASUVORK5CYII=";
89 b64images["ud.png"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAIAAADAAbR1AAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAA7ElEQVQ4y2N48SIpSUmJdiTDqAVKSp8+zZghLPzv37VrTEx//166xMxMZQtevy4slJP78WP7dm7u///v3WNgwGLBnz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HaiAUllXVmJ1UlSGBITP69XZU9qdXlESywwRkHfv6enIrs0s8uCECHCFNPaEFfYARTVEmUACWjFtLrnBleHlad5yIL5QSm6rrZFPZ0RVnnMgB1BA1NHJICfe3s/fLdVBAKRCzCa/Jci8oMaz3E4KbCafcXN7XEeoqZWuIcQSacuGps68np66ehNBsAA7q2aAdXtkcXSHvjLU6RwiFnoqMpLqHAj/sjHCmQCutDB5t6/XDgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wNS0xOFQxNDo1OTowMSswMjowMCdFvu4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDUtMThUMTQ6NTg6MjkrMDI6MDDIECR2AAAAAElFTkSuQmCC";
93
94 <?php
95 // 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
96 // try optipng
97 // for f in *.png; do echo "b64images[\"${f}\"] = \"$(base64 $f | tr -d '\n')\";"; done > tmp.js
98 ?>
99
100 var se = new Object(); // object of search engines
101 // se["keyword"] = ["displayed name, max 7 chars", "url to which the querystring can be append", "b64images name"];
102 se["ii"] = ["ixquick", "https://eu.ixquick.com/do/search?q=", "ixquick.png"];
103 se["id"] = ["ixq_de", "https://eu.ixquick.com/do/search?l=deutsch&q=", "ixquick.png"];
104 se["wp"] = ["wp_de", "https://de.wikipedia.org/wiki/Spezial:Search?search=", "wp.png"];
105 se["wpe"] = ["wp_en", "https://en.wikipedia.org/wiki/Special:Search?search=", "wp.png"];
106 se["sp"] = ["strtpge", "https://startpage.com/do/search?query=", "sp.png"];
107 se["dd"] = ["dd_go", "https://duckduckgo.com/html/?ka=n&kh=1&kl=wt-wt&kp=-1&kt=n&kv=1&ky=-1&q=", "dd.png"];
108 se["gg"] = ["google", "https://www.google.com/search?hl=de&safe=off&q=", "gg.png"];
109 se["im"] = ["ixq_img", "https://startpage.com/do/search?cat=pics&query=", "ixquick.png"];
110 se["gi"] = ["gg_img", "https://www.google.com/images?hl=de&safe=off&q=", "gb.png"];
111 se["wb"] = ["wb", "http://www.woerterbuch.info/?query=", "wb.png"];
112 se["leo"] = ["leo", "https://dict.leo.org/ende/index_en.html#/searchLoc=0&resultOrder=basic&multiwordShowSingle=on&search=", "leo.png"];
113 se["ud"] = ["ud", "http://www.urbandictionary.com/define.php?term=", "ud.png"];
114 se["gt"] = ["gg_tl", "https://translate.google.de/?hl=de&tab=wT#en|de|", "ggtl.png"];
115 se["osm"] = ["osm", "https://www.openstreetmap.org/?query=", "osm.png"];
116 se["gm"] = ["g-maps", "https://www.google.de/maps/preview?hl=de&q=", "gm.png"];
117 se["uu"] = ["uu_wiki", "http://wiki.ubuntuusers.de/", "uu.png"];
118 se["man"] = ["u_man", "http://manpages.ubuntu.com/cgi-bin/search.py?ie=UTF-8&titles=Title&q=", "man-u.png"];
119 se["ups"] = ["ups", "http://packages.ubuntu.com/search?searchon=names&suite=all&section=all&keywords=", "man-u.png"];
120 se["yt"] = ["youtube", "https://www.youtube.com/results?search_query=", "yt.png"];
121 se["imdb"] = ["imdb", "http://www.imdb.com/find?s=all&q=", "imdb.png"];
122 se["az"] = ["amazon", "https://www.amazon.de/s/?url=search-alias%3Daps&field-keywords=", "az.png"];
123 se["php"] = ["php.net", "http://de2.php.net/manual-lookup.php?lang=de&pattern=", "php.png"];
124 se["sh"] = ["slfhtml", "http://de.selfhtml.org/navigation/suche/index.htm?Suchanfrage=", "sh.png"];
125 se["down"] = ["down", "http://www.downforeveryoneorjustme.com/", "down.png"];
126
127 function display_searchbuttons() {
128     document.getElementById("searchbuttons").innerHTML = "";
129     for ( kw in se ) {
130         document.getElementById("searchbuttons").innerHTML += '<button type="button" value="' + se[kw][0] + '" onclick=\'location.href="' + se[kw][1] + '" + document.getElementById("querystring").value\'><img src="data:image/png;base64,' + b64images[se[kw][2]] + '" alt="">&nbsp;' + se[kw][0] + "</button> \n";
131     }
132 }
133
134 function parse_fragmentstring() {
135     var fragmentstring = document.URL.substr( document.URL.split("#")[0].length + 1 );
136     if ( fragmentstring == "" ) {
137         display_searchbuttons();
138         document.getElementById("querystring").focus();
139     } else {
140         fragmentarr = fragmentstring.replace("%20", "+").split("+");
141         if ( se[fragmentarr[0]] ) {
142             // first word in query is a keyword
143             kw = fragmentarr[0];
144             fragmentarr.shift();
145             location.href = se[kw][1] + fragmentarr.join(" ");
146         } else {
147             // there is no keyword
148 <?php
149 if ( $dse ) {
150     // use a default searchengine
151     echo '            location.href = se["' . $dse . '"][1] + fragmentarr.join(" ");
152 ';
153 } else {
154     // display all buttons and write the fragmentstring into the querystring input
155     echo '            document.getElementById("querystring").value = fragmentarr.join(" ");
156             display_searchbuttons();
157 ';
158 }
159 ?>
160         }
161     }
162 }
163 </script>
164
165 </head>
166
167 <body onload="parse_fragmentstring();">
168
169 <h1><a href="">fpunktk.de/consearch</a></h1>
170
171 <noscript>
172 <p style="color: red; font-size: 200%; font-weight: bold;">
173 please enable javascript
174 </p>
175 </noscript>
176
177 <div>
178 <label><input id="querystring" type="text"></label>
179 </div>
180
181 <div id="searchbuttons">
182 </div>
183
184 <p>
185 <a href="https://github.com/fpunktk/consearch">about</a>
186 </p>
187
188 </body>
189 </html>
190