X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=blobdiff_plain;f=index.php;h=bd3ea592c233e5d0bbb269d9a950504aaccbe81f;hp=bc0de0c81c900972f6ca135532cdf4eea0f3f090;hb=50383593c4e02b1bf0ffc025bea3f97c09ab13a8;hpb=57a0c78ea2ce9b38e8d8753e5d1610686ba7daf4 diff --git a/index.php b/index.php index bc0de0c..bd3ea59 100644 --- a/index.php +++ b/index.php @@ -11,24 +11,33 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/. */ -$dse = ""; +$consearch_name = "consearch"; +$consearch_base_url = "https://fpunktk.de/consearch/"; +$consearch_url = "$consearch_base_url" . "index.php"; + +$dse = ""; // default search engine 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'; +' . "$consearch_name"; if ( $dse ) { echo " ($dse)"; } echo ' conveniently use different searchengines consearch consearch @ f p u n k t k . de - -https://www.fpunktk.de/consearch/consearch.png + echo '#{searchTerms}"> +' . "$consearch_base_url" . 'consearch.png '; exit; @@ -41,15 +50,16 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { -consearch + +<?php echo "$consearch_name";?> 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["qq"] = ["qwant_l", "https://lite.qwant.com/?t=web&s=0&b=0&q=", ""]; +se["qi"] = ["qw_img", "https://lite.qwant.com/?t=images&s=0&b=0&q=", ""]; 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["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"]; +se["mg"] = ["metager", "https://metager.de/meta/meta.ger3?eingabe=", ""]; +se["wb"] = ["wb", "http://www.woerterbuch.info/?query=", ""]; +se["leo"] = ["leo", "https://dict.leo.org/german-english/", "leo.png"]; +se["lg"] = ["linguee", "https://www.linguee.com/search?source=auto&query=", ""] +se["dc"] = ["dict.cc", "https://www.dict.cc/?s=", ""]; se["gt"] = ["gg_tl", "https://translate.google.de/?hl=de&tab=wT#en|de|", "gg.png"]; +se["ud"] = ["ud", "http://www.urbandictionary.com/define.php?term=", "ud.png"]; 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://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"]; @@ -161,18 +179,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_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["ye"] = ["you-eng", "https://youglish.com/search/", ""]; +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 +239,7 @@ if ( $dse ) { -

fpunktk.de/consearch

+

+' . "\n"; +} +?> +
@@ -227,11 +262,27 @@ please enable javascript

-add to browser +add to browser

+ + +

+Now add $consearch_name to your browser. In firefox this is done via the search bar or the ⋯-button in the address bar. If this does not work then $consearch_name can be added via the following form (right-click the input and select \"Add a Keyword for this Search...\"), but this would send all queries to the server and is not recommended. +

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

-about +about | contact