Skip to content

Commit

Permalink
Merge pull request #10 from dvishal485/main
Browse files Browse the repository at this point in the history
remove "Date:" from date component
  • Loading branch information
dvishal485 authored Aug 27, 2024
2 parents 8f9647f + dcce9ac commit 3f2c433
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ fn clean_text(s: Node) -> String {
fn get_date(s: Node) -> Option<String> {
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
}
Expand Down

0 comments on commit 3f2c433

Please sign in to comment.