server: add slurp configs for facebook and redox

This commit is contained in:
Bill Thiede 2024-09-11 11:41:09 -07:00
parent 91eb3019f9
commit 1985ae1f49

View File

@ -176,10 +176,16 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
let body_tranformers: Vec<Box<dyn Transformer>> = vec![
Box::new(SlurpContents {
site_selectors: hashmap![
"atmeta.com".to_string() => vec![
Selector::parse("div.entry-content").unwrap(),
],
"blog.cloudflare.com".to_string() => vec![
Selector::parse(".author-lists").unwrap(),
Selector::parse(".post-full-content").unwrap()
],
"engineering.fb.com".to_string() => vec![
Selector::parse("article").unwrap(),
],
"hackaday.com".to_string() => vec![
Selector::parse("div.entry-featured-image").unwrap(),
Selector::parse("div.entry-content").unwrap()
@ -192,6 +198,9 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
Selector::parse("span.story-byline").unwrap(),
Selector::parse("div.p").unwrap(),
],
"www.redox-os.org".to_string() => vec![
Selector::parse("div.content").unwrap(),
],
"www.smbc-comics.com".to_string() => vec![
Selector::parse("img#cc-comic").unwrap(),
Selector::parse("div#aftercomic img").unwrap(),