X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=94cd9cae953d6dc115a9b067b52be8dabd90746a;hp=bc0de0c81c900972f6ca135532cdf4eea0f3f090;hb=ddb92b4e8d30c014524aa0ccb17a70f679b1e121;hpb=57a0c78ea2ce9b38e8d8753e5d1610686ba7daf4 diff --git a/index.php b/index.php index bc0de0c..94cd9ca 100644 --- a/index.php +++ b/index.php @@ -15,8 +15,13 @@ $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']; } +$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'; @@ -27,7 +32,7 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { consearch @ f p u n k t k . de + echo '#{searchTerms}"> https://www.fpunktk.de/consearch/consearch.png '; @@ -44,7 +49,7 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { consearch tmp.js ?> @@ -137,8 +143,10 @@ se["sp"] = ["strtpge", "https://startpage.com/do/search?query=", "sp.png"]; 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"]; se["sx"] = ["searx", "https://searx.me/?q=", ""]; se["gg"] = ["google", "https://www.google.com/search?hl=de&safe=off&q=", "gg.png"]; +se["wa"] = ["wolfram", "https://www.wolframalpha.com/input/?i=", ""]; se["si"] = ["sp_img", "https://startpage.com/do/search?cat=pics&query=", "sp.png"]; se["gi"] = ["gg_img", "https://www.google.com/images?hl=de&safe=off&q=", "gg.png"]; +se["mg"] = ["metager", "https://metager.de/meta/meta.ger3?eingabe=", ""]; se["wb"] = ["wb", "http://www.woerterbuch.info/?query=", "wb.png"]; se["leo"] = ["leo", "https://dict.leo.org/ende/index_en.html#/searchLoc=0&resultOrder=basic&multiwordShowSingle=on&search=", "leo.png"]; se["ud"] = ["ud", "http://www.urbandictionary.com/define.php?term=", "ud.png"]; @@ -147,7 +155,9 @@ se["osm"] = ["osm", "https://www.openstreetmap.org/?query=", "osm.png"]; se["gm"] = ["g-maps", "https://www.google.de/maps/preview?hl=de&q=", "gm.png"]; se["uu"] = ["uu_wiki", "http://wiki.ubuntuusers.de/", "uu.png"]; se["man"] = ["u_man", "http://manpages.ubuntu.com/cgi-bin/search.py?ie=UTF-8&titles=Title&q=", "man-u.png"]; -se["ups"] = ["ups", "http://packages.ubuntu.com/search?searchon=names&suite=all§ion=all&keywords=", "man-u.png"]; +se["dps"] = ["deb-pkg", "https://packages.debian.org/search?searchon=names&suite=all§ion=all&keywords=", ""]; +se["ups"] = ["uu-pkg", "http://packages.ubuntu.com/search?searchon=names&suite=all§ion=all&keywords=", "man-u.png"]; +se["fps"] = ["fed-pkg", "https://admin.fedoraproject.org/pkgdb/packages/?motif=*", ""]; 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"]; @@ -161,18 +171,26 @@ se["gh"] = ["github", "https://github.com/search?utf8=✓&q=", ""]; se["bb"] = ["bing", "https://www.bing.com/search?q=", ""]; se["mdn"] = ["mdn", "https://developer.mozilla.org/search?q=", ""]; se["ctan"] = ["ctan", "http://ctan.org/search/?phrase=", ""]; -se["gpg"] = ["gpg_key", "https://pgp.mit.edu/pks/lookup?op=index&fingerprint=on&search=", ""]; +se["so"] = ["stck-of", "http://stackoverflow.com/search?q=", ""]; +se["gpg"] = ["pgp.mit", "https://pgp.mit.edu/pks/lookup?op=index&fingerprint=on&search=", ""]; +se["amo"] = ["amo", "https://addons.mozilla.org/search/?q=", ""]; se["gsm"] = ["gsm", "http://www.gsmarena.com/results.php3?sQuickSearch=yes&sName=", ""]; +se["ck"] = ["chfkch", "http://www.chefkoch.de/suche.php?wo=2&suche=", ""]; +se["ypi"] = ["ypi", "http://youpronounce.it/search.jsp?q=", ""]; +se["ks"] = ["ks", "https://kraut.space/start?do=search&id=", "ks.png"]; function display_searchbuttons() { document.getElementById("searchbuttons").innerHTML = ""; for ( kw in se ) { - document.getElementById("searchbuttons").innerHTML += ' \n"; + document.getElementById("searchbuttons").innerHTML += ' \n"; } } function parse_fragmentstring() { var fragmentstring = document.URL.substr( document.URL.split("#")[0].length + 1 ); + if ( fragmentstring == "" ) { + var fragmentstring = document.URL.substr( document.URL.split("consearchterm=")[0].length + 14 ); + } if ( fragmentstring == "" ) { display_searchbuttons(); document.getElementById("querystring").focus(); @@ -211,7 +229,7 @@ if ( $dse ) { -

fpunktk.de/consearch

+

fpunktk.de/consearch

+' . "\n"; +} +?> +
@@ -227,9 +252,25 @@ please enable javascript

-add to browser +add to browser +

+ + + +

+Now add consearch to your browser. In firefox this is done via the searchbar. If this does not work then consearch can be added via the following form, but this would send all queries to the server :-(

+
' . "\n"; + if ( $dse ) { echo '' . "\n"; } + echo ' +
+'; +} +?> +

about