diff --git a/.gitignore b/.gitignore index ea8c4bf..e684164 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target + +/deploy.sh diff --git a/README b/README index 8b3fe26..4e74e91 100644 --- a/README +++ b/README @@ -1 +1,13 @@ a cute metasearch engine + +it sources from google, bing, brave, and a few others. + +it's written in rust using no templating engine and with as little client-side +javascript as possible. + +metasearch is a single binary with no cli or configuration file. if you want to +configure it (like to change the default port or weights of engines) then you +have to modify the source. + +build it with `cargo b -r`, the resulting binary will be in `target/release/metasearch2`. +it runs on port 28019. diff --git a/src/engines/answer/calc.rs b/src/engines/answer/calc.rs index 58408be..9a2f51a 100644 --- a/src/engines/answer/calc.rs +++ b/src/engines/answer/calc.rs @@ -57,7 +57,10 @@ fn evaluate(query: &str, html: bool) -> Option { let mut result_html = String::new(); for span in result.get_main_result_spans() { let class = match span.kind() { - fend_core::SpanKind::Number | fend_core::SpanKind::Boolean => "answer-calc-constant", + fend_core::SpanKind::Number + | fend_core::SpanKind::Boolean + | fend_core::SpanKind::Date => "answer-calc-constant", + fend_core::SpanKind::String => "answer-calc-string", _ => "", }; if !class.is_empty() { diff --git a/src/web/assets/script.js b/src/web/assets/script.js index 1cd6fe0..7406dc2 100644 --- a/src/web/assets/script.js +++ b/src/web/assets/script.js @@ -1,5 +1,6 @@ -// add a datalist after the search input const searchInputEl = document.getElementById("search-input"); + +// add a datalist after the search input const datalistEl = document.createElement("datalist"); datalistEl.id = "search-input-datalist"; searchInputEl.setAttribute("list", datalistEl.id); diff --git a/src/web/assets/style.css b/src/web/assets/style.css index e42d063..2bad94e 100644 --- a/src/web/assets/style.css +++ b/src/web/assets/style.css @@ -137,3 +137,9 @@ h1 { color: #d2a6ff; white-space: pre; } +.answer-calc-string { + color: #aad94c; +} +.answer-calc-special { + color: #e6b673; +} diff --git a/src/web/mod.rs b/src/web/mod.rs index 94c45fb..e21975f 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -5,7 +5,7 @@ use std::net::SocketAddr; use axum::{http::header, routing::get, Router}; -pub const BIND_ADDRESS: &str = "[::]:3000"; +pub const BIND_ADDRESS: &str = "[::]:28019"; pub async fn run() { let app = Router::new()