pub / serci

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

commit b6c9119aefa07c130e6568a81f4fc590b030087b
parent 8abe39df700dfa4679ba1d5764a9eb45296b39ba
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Mon, 25 May 2026 12:23:11 +0200

feat: add option to parse metager token

Diffstat:
MREADME.md | 12++++++++++--
Mconfig/config.php | 10++++++----
Mindex.php | 4++--
3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md @@ -36,8 +36,16 @@ is geared towards privacy and data minimalism. However, you can simply host serĉi yourself any time and configure your own favorite search engines and `!keywords`. -If you think there are `!keywords` that other people would benefit from, feel free -to contribute! +If you think there are `!keywords` that other people would benefit from, feel +free to contribute! + +*Note:* In the case of the paid search engine Metager, which requires +a `key` or `token` to be used, you can forward this token through +serĉi with the `%opt` replacement, e.g.: `!metager:key=abc` for example +in private browsing mode. For private mode browser such as Firefox +Klar, you could then apply the search URL in the settings like so: +`https://search.example.com/?fallback=metagerweb&q=!metager:key=abc%s`. +**BEWARE: the serĉi host is technically able to read this information as well!** ### How can I use serĉi? diff --git a/config/config.php b/config/config.php @@ -291,18 +291,20 @@ $searches = array( "metagerweb" => array( "name" => "MetaGer", "website" => "https://metager.de/?focus=web", - "query" => "https://metager.de/meta/meta.ger3?focus=web&eingabe=%s", + "query" => "https://metager.de/meta/meta.ger3?%opt&focus=web&eingabe=%s", + "default_opts" => "", // may be used with the "key=ABC" parameter "categories" => array("web", "meta", "subscription"), "keywords" => array("metagerweb", "metager", "meta", "mg", "metaweb"), - "description" => "A metasearch engine focused on protecting privacy, hosted as a cooperation between the German NGO SUMA-EV and the University of Hannover. Since August 2024 only available through a paid model" + "description" => "A metasearch engine focused on protecting privacy, hosted as a cooperation between the German NGO SUMA-EV and the University of Hannover. Since August 2024 only available through a paid model. You can apply your key cookie-less with the !metagerweb:key=abc option" ), "metagerimg" => array( "name" => "MetaGer Images", "website" => "https://metager.de/?focus=bilder", - "query" => "https://metager.de/meta/meta.ger3?focus=bilder&eingabe=%s", + "query" => "https://metager.de/meta/meta.ger3?%opt&focus=bilder&eingabe=%s", + "default_opts" => "", // may be used with the "key=ABC" parameter "categories" => array("img", "meta", "foss", "subscription"), "keywords" => array("metagerimg", "metaimg"), - "description" => "A metasearch engine focused on protecting privacy, hosted as a cooperation between the German NGO SUMA-EV and the University of Hannover. Since August 2024 only available through a paid model" + "description" => "A metasearch engine focused on protecting privacy, hosted as a cooperation between the German NGO SUMA-EV and the University of Hannover. Since August 2024 only available through a paid model. . You can apply your key cookie-less with the !metagerimg:key=abc option" ), "metagermap" => array( "name" => "MetaGer Maps", diff --git a/index.php b/index.php @@ -38,9 +38,9 @@ if (strlen($query) > 0) { - /* Find keywords (only first one is considered) */ + /* Find keywords (only last one is considered) */ $keyword = preg_replace( - '/^.*?\!([A-Za-z0-9_\-\.]+).*$/', + '/^.*\!([A-Za-z0-9_\-\.]+).*?$/', '${1}', $query );