wayback_urls/
lib.rs

1//! # Library to query the memetos from the internet archives wayback machine
2//!
3//! This library contains an implementation of a builder/typestate pattern
4//! to generate URLs for use with the Internet Archive's [Wayback Machine].
5//!
6//! You still need to use an HTTP client of your choice to fetch and parse the
7//! page.
8//!
9//! [Wayback Machine]: http://web.archive.org/
10//!
11//! ## Usage
12//!
13//! ```
14//! use wayback_urls::timemap::{Request, Field::{Timestamp, StatusCode, UrlKey}};
15//!
16//! let r = Request::builder("nexushq.universe.lego.com/en-us/character/details")
17//!                 .match_prefix()
18//!                 .with_field(Timestamp)
19//!                 .with_field(UrlKey)
20//!                 .filter_inverted(StatusCode, "[45]..")
21//!                 .collapse(UrlKey)
22//!                 .done().to_url();
23//! assert_eq!(&r, "https://web.archive.org/web/timemap/\
24//! ?url=nexushq.universe.lego.com%2Fen-us%2Fcharacter%2Fdetails\
25//! &fl=timestamp,urlkey\
26//! &matchType=prefix\
27//! &collapse=urlkey\
28//! &filter=!statuscode:[45]..");
29//! ```
30//!
31//! ## Future work (Examples)
32//! * <https://web.archive.org/__wb/sparkline?url={}&collection=web&output=json>
33//! * <https://web.archive.org/web/timemap/>
34
35pub mod timemap;