Some small changes.
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
use unhtml::FromHtml;
|
||||
use unhtml_derive::FromHtml;
|
||||
|
||||
use crate::context::Context;
|
||||
use crate::probe::Probe;
|
||||
|
||||
#[derive(Debug, FromHtml)]
|
||||
#[html(selector = ".error-box")]
|
||||
struct Error {
|
||||
#[html(selector = "h2", attr = "inner")]
|
||||
message: String,
|
||||
}
|
||||
|
||||
// https://gulasidorna.eniro.se/hitta:{}
|
||||
pub struct Eniro;
|
||||
|
||||
@@ -17,5 +27,10 @@ impl Probe for Eniro {
|
||||
|
||||
ctx.cache_set("eniro", &number, body.as_bytes())
|
||||
.expect("wut?! why not?!");
|
||||
|
||||
if let Ok(error) = Error::from_html(&body) {
|
||||
println!("eniro.se:");
|
||||
println!(" {}", error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user