X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=94cd9cae953d6dc115a9b067b52be8dabd90746a;hp=a4e8442df299f0ef6c7905e60a58fe44893f2127;hb=ddb92b4e8d30c014524aa0ccb17a70f679b1e121;hpb=0e56febe1c99436a1467cb4ee346284dc8c5a292 diff --git a/index.php b/index.php index a4e8442..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,8 +171,13 @@ 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_mit", "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 = ""; @@ -173,6 +188,9 @@ function display_searchbuttons() { 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(); @@ -219,6 +237,13 @@ please enable javascript

+' . "\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