archiveis-rs
Provides simple access to the Archive.is Capturing Service. Archive any url and get the corresponding archive.is link in return.
Examples
The ArchiveClient
is build with hyper
and therefor uses futures for its services.
Archive single url
extern crate archiveis;
extern crate futures;
extern crate tokio_core;
use ArchiveClient;
use Future;
use Core;
Archive mutliple urls
archive.is uses a temporary token to validate a archive request.
The ArchiveClient
capture
function first obtains the token via a GET request.
The token is usually valid several minutes, and even if archive.is switches to a new token,the older ones are still valid. So if we need to archive multiple links, we can only need to obtain the token once and then invoke the capturing service directly with capture_with_token
for each url. This can be done using the future::join
functionality.
In the following case the designated join_all
function is used to get Future of a Vec<Archived>
.
An undesired sideeffect if the join_all
is that this returns an Error if any of the futures failed.
The Capturing service should work fine in most cases but if individual error handling is desired, the capturing futures can be wrapped inside another Result
. In an And_Then
we can handle those failures.
extern crate archiveis;
extern crate futures;
extern crate tokio_core;
use ArchiveClient;
use ;
use Core;
Commandline Interface
archiveis
also comes as commandline application:
Coming soon