Crate archiveis[][src]

archiveis - Rust API Wrapper for Archive.is

This crate provides simple access to the Archive.is Capturing Service.

Quick Start

Creating a Client

To create a client to access the Archive.is Capturing Service, you should use the ArchiveClient struct. You can pass a specific user agent or none to use a default one. To capture a specific url all you need to do is call the capture function of the client provided with the desired url.

Archive a url

The ArchiveClient is build with hyper and therefor uses futures for its services.

extern crate archiveis;
extern crate futures;

use archiveis::ArchiveClient;
use futures::future::Future;

let client = ArchiveClient::new(Some("archiveis (https://github.com/MattsSe/archiveis-rs)"));
let url = "http://example.com/";
let capture = client.capture(url).and_then(|res| {
    if let Some(archived) = res {
        println!("targeted url: {}", archived.target_url);
        println!("url of archived site: {}", archived.archived_url);
        println!("archive.is submit token: {}", archived.submit_id);
    }
    Ok(())
});

Structs

ArchiveClient

A Client that serves as a wrapper around the archive.is capture service

Archived

Represents a result of the capture service