From dcce9ac9554e3a86bcd9645fc48e0bfdf2d4ea04 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 27 Aug 2024 11:21:36 +0530 Subject: [PATCH] remove "Date:" from date component Signed-off-by: Vishal --- src/scrape.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/scrape.rs b/src/scrape.rs index c523fca..b098602 100644 --- a/src/scrape.rs +++ b/src/scrape.rs @@ -117,7 +117,15 @@ fn clean_text(s: Node) -> String { fn get_date(s: Node) -> Option { s.next().and_then(|date_elem| { if date_elem.name() == Some("small") { - Some(date_elem.text().trim().to_owned()) + Some( + date_elem + .text() + .trim() + .trim_start_matches("Date") + .trim_start_matches("date") + .trim_start_matches([':', ' ']) + .to_owned(), + ) } else { None }