X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=0bbedc9bf9b148fa097b01bd99bc00e3eed40147;hp=a708d9634a0f6ccce8eea9e5d446c5fb68648fe8;hb=4cdcc7964e10136c16cc44a003de7ce230cfabcf;hpb=d4d318ef1d1c4ece67b654a2730ac63a68e77020 diff --git a/index.php b/index.php index a708d96..0bbedc9 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 ?> var se = new Object(); // object of search engines // se["keyword"] = ["displayed name, max 7 chars", "url to which the querystring can be appended", "b64images name"]; -se["ii"] = ["ixquick", "https://eu.ixquick.com/do/search?q=", "ixquick.png"]; -se["id"] = ["ixq_de", "https://eu.ixquick.com/do/search?l=deutsch&q=", "ixquick.png"]; +se["ii"] = ["startpg", "https://www.startpage.com/do/search?query=", "sp.png"]; +se["id"] = ["sp_de", "https://www.startpage.com/do/search?cmd=process_search&language=deutsch&with_language=lang_de&query=", "sp.png"]; se["wp"] = ["wp_de", "https://de.wikipedia.org/wiki/Spezial:Search?search=", "wp.png"]; se["wpe"] = ["wp_en", "https://en.wikipedia.org/wiki/Special:Search?search=", "wp.png"]; -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"]; @@ -149,6 +157,8 @@ 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["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://apps.fedoraproject.org/packages/s/", ""]; +se["lps"] = ["lnxpkgs", "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"]; @@ -162,10 +172,15 @@ 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["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 = ""; @@ -176,6 +191,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(); @@ -222,6 +240,13 @@ please enable javascript

+' . "\n"; +} +?> +
@@ -230,11 +255,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