From 26632e3474fd4c7aba1b5c180cf8e6b72c7dde6a Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 28 Apr 2024 18:31:22 +0200 Subject: works --- src/info.rs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/info.rs (limited to 'src/info.rs') diff --git a/src/info.rs b/src/info.rs new file mode 100644 index 0000000..433bb13 --- /dev/null +++ b/src/info.rs @@ -0,0 +1,58 @@ +use crate::{s_file, Template}; +use markup::{doctype, DynRender}; +use rocket::{get, http::ContentType}; + +#[get("/")] +pub fn r_index<'a>() -> Template> { + Template(markup::new! { + @doctype() + html { + head { + title { "meta adservices" } + meta[name="viewport", content="width=device-width, initial-scale=1.0"]; + meta[name="description", content="advertise now with meta adservices"]; + link[rel="stylesheet", href="/style.css"]; + } + body { + h1 { "meta adservices" } + p { + "meta adservices is the leading provider of useless images within iframes. " + } + + h2 { "sample ad" } + iframe[src="/v1/embed?s=adservices.metamuffin.org", style="border:none;width:728px;height:90px;"] {} + h2 { "privacy" } + p { "data used by meta adservices: " } + ul { + li { "Your IP address" } + li { "The Advertisement site (where the ad was shown)" } + } + p { "data stored by meta adservices: " } + ul { + li { "Your IP address is used within a bloom filter in volatile memory." } + li { "Your requests increment a persistent public counter per ad site (according to a weighting function)." } + } + } + } + }) +} + +#[get("/style.css")] +pub fn r_style() -> (ContentType, String) { + (ContentType::CSS, s_file!("style.css")) +} + +#[cfg(not(debug_assertions))] +#[macro_export] +macro_rules! s_file { + ($path: literal) => { + include_str!($path).to_string(), + }; +} +#[cfg(debug_assertions)] +#[macro_export] +macro_rules! s_file { + ($path: literal) => { + std::fs::read_to_string(concat!("src/", $path)).unwrap() + }; +} -- cgit v1.2.3-70-g09d2