X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=393ac3553ff915a3b03d8b7c43c51c9cda490bc3;hp=107cff32ead789f34c333b62d2c6910ba6c3c2e4;hb=f060755e553e6b3ab2adb8a35967073b697125a1;hpb=efd7e92fc2f52dc157359b99f471be8b8defeeda diff --git a/index.php b/index.php index 107cff3..393ac35 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'; @@ -25,10 +30,10 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { conveniently use different searchengines consearch consearch @ f p u n k t k . de - -https://www.fpunktk.de/consearch/consearch.png + echo '#{searchTerms}"> +https://fpunktk.de/consearch/consearch.png '; exit; @@ -41,10 +46,11 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { + consearch tmp.js ?> @@ -137,8 +144,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 +156,10 @@ 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["lps"] = ["pkgs", "https://pkgs.org/download/", ""]; 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 +173,28 @@ 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"]; +se["obi"] = ["obi", "https://www.obi.de/search/", ""]; +se["ikea"] = ["ikea", "https://www.ikea.com/de/de/search/?query=", ""]; 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 +233,7 @@ if ( $dse ) { -

fpunktk.de/consearch

+

fpunktk.de/consearch

+' . "\n"; +} +?> +
@@ -227,11 +256,27 @@ 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 +about | contact