pub / serci

Search the web with !keywords
git clone https://https://src.jayvii.de/pub/serci.git
Home | Log | Files | Exports | Refs | README | RSS

commit f924fbe59158ffa1eae8f2ec61a28547cff04d6f
parent 0e213ffcb95a887949c6c216c117aeda2002f7b4
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 12 Jul 2024 12:07:44 +0200

feat: use "everything" category to reduce codebase

Diffstat:
Mconfig/config.php | 81+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mindex.php | 43-------------------------------------------
2 files changed, 42 insertions(+), 82 deletions(-)

diff --git a/config/config.php b/config/config.php @@ -10,119 +10,119 @@ $searches = array( "name" => "Arch Wiki", "website" => "https://wiki.archlinux.org", "query" => "https://wiki.archlinux.org/index.php?search=%s", - "categories" => array("wiki", "linux"), + "categories" => array("everything", "wiki", "linux"), "keywords" => array("archwiki", "arch", "aw") ), "base" => array( "name" => "BASE", "website" => "https://www.base-search.net", "query" => "https://www.base-search.net/Search/Results?lookfor=%s", - "categories" => array("sci"), + "categories" => array("everything", "sci"), "keywords" => array("base", "basesearch", "science") ), "codeberg" => array( "name" => "Codeberg", "website" => "https://codeberg.org", "query" => "https://codeberg.org/explore/repos?q=%s", - "categories" => array("code", "git"), + "categories" => array("everything", "code", "git"), "keywords" => array("codeberg", "cb") ), "cran" => array( "name" => "CRAN", "website" => "https://cran.r-project.org", "query" => "https://search.r-project.org/?P=%s", - "categories" => array("code", "docu"), + "categories" => array("everything", "code", "docu"), "keywords" => array("cran", "rcran", "r") ), "debianwiki" => array( "name" => "Debian Wiki", "website" => "https://wiki.debian.org", "query" => "https://wiki.debian.org/?action=fullsearch&value=%s", - "categories" => array("wiki", "linux"), + "categories" => array("everything", "wiki", "linux"), "keywords" => array("debianwiki", "debian", "deb", "dw") ), "deepl" => array( "name" => "DeepL (en-de)", "website" => "https://deepl.com", "query" => "https://www.deepl.com/translator#de/en/%s", - "categories" => array("lang"), + "categories" => array("everything", "lang"), "keywords" => array("deepl") ), "dictcc" => array( "name" => "dict.cc", "website" => "https://dict.cc", "query" => "https://m.dict.cc/?s=%s", - "categories" => array("lang"), + "categories" => array("everything", "lang"), "keywords" => array("dictcc", "dict", "translate", "tl") ), "dockerhub" => array( "name" => "dockerhub", "website" => "https://hub.docker.com", "query" => "https://hub.docker.com/search?q=%s", - "categories" => array("software", "linux"), + "categories" => array("everything", "software", "linux"), "keywords" => array("dockerhub", "docker", "dh") ), "duden" => array( "name" => "Duden", "website" => "https://www.duden.de", "query" => "https://www.duden.de/suchen/dudenonline/%s", - "categories" => array("lang"), + "categories" => array("everything", "lang"), "keywords" => array("duden", "ger", "de") ), "fdroid" => array( "name" => "F-Droid", "website" => "https://f-droid.org", "query" => "https://search.f-droid.org/?q=%s", - "categories" => array("software", "android"), + "categories" => array("everything", "software", "android"), "keywords" => array("fdroid", "droid", "fd", "android") ), "flathub" => array( "name" => "Flathub", "website" => "https://flathub.org", "query" => "https://flathub.org/apps/search?q=%s", - "categories" => array("software", "linux"), + "categories" => array("everything", "software", "linux"), "keywords" => array("flathub", "flatpak", "fh", "fp") ), "github" => array( "name" => "GitHub", "website" => "https://github.com", "query" => "https://github.com/search?q=%s", - "categories" => array("code", "git"), + "categories" => array("everything", "code", "git"), "keywords" => array("github", "gh") ), "googlescholar" => array( "name" => "Google Scholar", "website" => "https://scholar.google.com", "query" => "https://scholar.google.com/scholar?q=%s", - "categories" => array("sci"), + "categories" => array("everything", "sci"), "keywords" => array("googlescholar", "gscholar") ), "internetarchive" => array( "name" => "Internet Archive", "website" => "https://archive.org", "query" => "https://archive.org/search?query=%s", - "categories" => array("archive"), + "categories" => array("everything", "archive"), "keywords" => array("internetarchive", "archive", "ia") ), "leo" => array( "name" => "LEO (en-de)", "website" => "https://leo.org", "query" => "https://dict.leo.org/englisch-deutsch/%s", - "categories" => array("lang"), + "categories" => array("everything", "lang"), "keywords" => array("leo") ), "metagerimg" => array( "name" => "MetaGer Images", "website" => "https://metager.de/?focus=bilder", "query" => "https://metager.de/meta/meta.ger3?focus=bilder&eingabe=%s", - "categories" => array("img", "meta"), + "categories" => array("everything", "img", "meta"), "keywords" => array("metagerimg", "metaimg") ), "metagermap" => array( "name" => "MetaGer Maps", "website" => "https://metager.de/?fokus=maps", "query" => "https://maps.metager.de/en/%s/guess", - "categories" => array("map"), + "categories" => array("everything", "map"), "keywords" => array( "metagermap", "metagermaps", "mgmap", "metamap", "map", "maps" ) @@ -131,7 +131,7 @@ $searches = array( "name" => "MetaGer Science", "website" => "https://metager.de/?focus=science", "query" => "https://metager.de/meta/meta.ger3?focus=science&eingabe=%s", - "categories" => array("sci", "meta"), + "categories" => array("everything", "sci", "meta"), "keywords" => array( "metagersci", "metagerscience", "metasci", "metascience" ) @@ -140,91 +140,91 @@ $searches = array( "name" => "MetaGer Web", "website" => "https://metager.de/?focus=web", "query" => "https://metager.de/meta/meta.ger3?focus=web&eingabe=%s", - "categories" => array("web", "meta"), + "categories" => array("everything", "web", "meta"), "keywords" => array("metagerweb", "metager", "meta", "mg", "metaweb") ), "mojeekimg" => array( "name" => "Mojeek Images", "website" => "https://mojeek.com/images", "query" => "https://www.mojeek.com/search?fmt=images&q=%s", - "categories" => array("img"), + "categories" => array("everything", "img"), "keywords" => array("mojeekimg", "mjimg") ), "mojeekweb" => array( "name" => "Mojeek Web", "website" => "https://mojeek.com", "query" => "https://www.mojeek.com/search?q=%s", - "categories" => array("web"), + "categories" => array("everything", "web"), "keywords" => array("mojeekweb", "mojeek", "mj") ), "npm" => array( "name" => "NPM", "website" => "https://www.npmjs.com", "query" => "https://www.npmjs.com/search?q=%s", - "categories" => array("code", "docu"), + "categories" => array("everything", "code", "docu"), "keywords" => array("npm", "npmjs", "node", "js") ), "oed" => array( "name" => "Oxford Dictionary", "website" => "https://www.oed.com", "query" => "https://www.oed.com/search/dictionary/?scope=Entries&q=%s", - "categories" => array("lang"), + "categories" => array("everything", "lang"), "keywords" => array("oed", "oxford", "eng", "uk") ), "openstreetmap" => array( "name" => "OpenStreetMap", "website" => "https://www.openstreetmap.org", "query" => "https://www.openstreetmap.org/search?query=%s", - "categories" => array("map"), + "categories" => array("everything", "map"), "keywords" => array("openstreetmap", "osm") ), "php" => array( "name" => "PHP Manual", "website" => "https://www.php.net", "query" => "https://www.php.net/manual-lookup.php?pattern=%s", - "categories" => array("docu"), + "categories" => array("everything", "docu"), "keywords" => array("php", "phpdoc", "phpdocs", "phpman", "phpmans") ), "pypi" => array( "name" => "PyPI", "website" => "https://pypi.org", "query" => "https://pypi.org/search/?q=%s", - "categories" => array("code", "docu"), + "categories" => array("everything", "code", "docu"), "keywords" => array("pypi", "python", "py") ), "qwantimg" => array( "name" => "Qwant Images", "website" => "https://qwant.com/?t=images", "query" => "https://www.qwant.com/?t=images&q=%s", - "categories" => array("img"), + "categories" => array("everything", "img"), "keywords" => array("qwantimg", "qwimg", "images", "image", "img") ), "qwantvideo" => array( "name" => "Qwant Videos", "website" => "https://qwant.com/?t=videos", "query" => "https://www.qwant.com/?t=videos&q=%s", - "categories" => array("vid"), + "categories" => array("everything", "vid"), "keywords" => array("qwantvideo", "qwvid", "videos", "vids", "vid") ), "qwantweb" => array( "name" => "Qwant Web", "website" => "https://qwant.com/?t=web", "query" => "https://www.qwant.com/?t=web&q=%s", - "categories" => array("web"), + "categories" => array("everything", "web"), "keywords" => array("qwantweb", "qwant", "qw") ), "semanticscholar" => array( "name" => "Semantic Scholar", "website" => "https://semanticscholar.org", "query" => "https://semanticscholar.org/search?q=%s", - "categories" => array("sci"), + "categories" => array("everything", "sci"), "keywords" => array("semanticscholar", "scholar", "literature") ), "sepiasearch" => array( "name" => "Sepia Search", "website" => "https://sepiasearch.org", "query" => "https://sepiasearch.org/search?search=%s", - "categories" => array("vid", "fedi"), + "categories" => array("everything", "vid", "fedi"), "keywords" => array( "sepiasearch", "sepia", "peertube", "pt" ) @@ -233,62 +233,65 @@ $searches = array( "name" => "Sourcehut", "website" => "https://sr.ht", "query" => "https://sr.ht/projects?search=%s", - "categories" => array("code", "git"), + "categories" => array("everything", "code", "git"), "keywords" => array("sourcehut", "srht", "sir") ), "stackoverflow" => array( "name" => "Stackoverflow", "website" => "https://stackoverflow.com", "query" => "https://stackoverflow.com/search?q=%s", - "categories" => array("code", "forum"), + "categories" => array("everything", "code", "forum"), "keywords" => array("stackoverflow", "so") ), "symbl" => array( "name" => "SYMBL", "website" => "https://symbl.cc", "query" => "https://symbl.cc/search/?q=%s", - "categories" => array("misc"), + "categories" => array("everything", "misc"), "keywords" => array("symbl", "symbol", "unicode") ), "w3schools" => array( "name" => "W3schools", /* Google CSE (!) */ "website" => "https://www.w3schools.com", "query" => "https://cse.google.com/cse?cx=c5f6ccbd4ce9405a8&q=%s", - "categories" => array("docu", "learn"), + "categories" => array("everything", "docu", "learn"), "keywords" => array("w3schools", "w3school", "www", "w3s", "webdev") ), "waybackmachine" => array( "name" => "Wayback Machine", "website" => "https://web.archive.org", "query" => "https://web.archive.org/web/99999999000000*/%s", - "categories" => array("archive"), + "categories" => array("everything", "archive"), "keywords" => array("waybackmachine", "webarchive", "wbm", "wb") ), "wikibookslatex" => array( "name" => "Wiki Books: LaTeX", "website" => "https://en.wikibooks.org/wiki/LaTeX", "query" => "https://en.wikibooks.org/wiki/Special:Search?prefix=LaTeX%2F&search=%s", - "categories" => array("docu", "learn", "wiki"), + "categories" => array("everything", "docu", "learn", "wiki"), "keywords" => array("wikibookslatex", "wblatex", "wbtex", "latex", "tex") ), "wikipedia" => array( "name" => "Wikipedia", "website" => "https://wikipedia.org", "query" => "https://wikipedia.org/wiki/%s", - "categories" => array("wiki"), + "categories" => array("everything", "wiki"), "keywords" => array("wikipedia", "wiki", "wp", "wk") ), "youtube" => array( "name" => "YouTube", "website" => "https://www.youtube.com", "query" => "https://www.youtube.com/results?search_query=%s", - "categories" => array("vid"), + "categories" => array("everything", "vid"), "keywords" => array("youtube", "yt") ), ); /* Categories */ $categories = array( + "everything" => array( + "name" => "All Search Engines", + ), "meta" => array( "name" => "Meta search engines", ), diff --git a/index.php b/index.php @@ -144,49 +144,6 @@ Toggle Categories </button> - <!-- List all Search engines in full table --> - <details open> - <summary>All Search Engines</summary> - <table> - <tr> - <th>Engine</th> - <th>keywords</th> - <tr> - - <?php - /* Print table row for each configured search engine */ - foreach (array_keys($searches) as $key) { - ?> - - <tr> - <td> - <a href="<?php echo $searches[$key]["website"]; ?>" - target="_blank"> - <?php - echo $searches[$key]["name"]; - ?> - </a> - </td> - <td> - <code> - <?php - echo "!" . - implode( - "</code>, <code>!", - $searches[$key]["keywords"] - ); - ?> - </code> - </td> - </tr> - - <?php - /* End for-loop across search engines */ - } - ?> - </table> - </details> - <!-- Search Engine Categorical Lists --> <?php foreach ($searchcats as $category => $searchids) {