waybackmachine-client

Crates.iowaybackmachine-client
lib.rswaybackmachine-client
version0.4.5
sourcesrc
created_at2024-03-27 11:33:41.477637
updated_at2024-11-25 08:10:21.65933
descriptionClient to archive URLs in the Internet Archive's Wayback Machine
homepage
repositoryhttps://github.com/thoth-pub/archive-pdf-urls/
max_upload_size
id1187810
size35,928
Javier Arias (ja573)

documentation

README

Wayback Machine Client

This Rust crate provides a client for interacting with the Wayback Machine, allowing users to archive URLs.

Build status Crates.io

Installation

cargo add waybackmachine-client

Usage

The WaybackMachineClient struct provides methods for archiving URLs using the Wayback Machine service. You can use the archive_url method to archive a URL asynchronously.

Example:

use waybackmachine_client::{ClientConfig, Error, WaybackMachineClient};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let wayback_client = WaybackMachineClient::new(ClientConfig::default());
    wayback_client.archive_url("https://www.example.com").await?;
    Ok(())
}

Features

  • Automatic Retry: The client automatically retries failed requests with exponential backoff, configurable via the ClientConfig.max_request_retries setting.
  • Recent Archive Check: The client checks if a URL has been archived within a specified threshold using the ClientConfig.archive_threshold_days setting.
  • Customisable Configuration: You can customise the client's behavior using the ClientConfig struct.
  • Asynchronous: Requests are sent asynchronously using the Tokio runtime
Commit count: 68

cargo fmt