mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-17 05:00:26 +00:00
* Update flake * Fix clippy's new suggestions * Do not ignore tests any longer since they work by now * Add ignore reason
18 lines
483 B
Rust
18 lines
483 B
Rust
use lychee_lib::archive::Archive;
|
|
use std::{error::Error, time::Duration};
|
|
use url::Url;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn Error>> {
|
|
let archive = Archive::WaybackMachine;
|
|
let url = Url::parse("https://example.com")?;
|
|
let result = archive
|
|
.get_archive_snapshot(&url, Duration::from_secs(10))
|
|
.await?;
|
|
|
|
if let Some(replacement) = result {
|
|
println!("Good news! {url} can be replaced with {replacement}");
|
|
}
|
|
|
|
Ok(())
|
|
}
|