Crates.io | wayback-urls |
lib.rs | wayback-urls |
version | 0.1.0 |
source | src |
created_at | 2020-08-04 20:20:13.970877 |
updated_at | 2020-08-04 20:20:13.970877 |
description | URL builder for the Internet Archives' Wayback-Machine |
homepage | |
repository | |
max_upload_size | |
id | 273011 |
size | 35,678 |
This library contains an implementation of a builder/typestate pattern to generate URLs for use with the Internet Archive's Wayback Machine.
You still need to use an HTTP client of your choice to fetch and parse the page.
use wayback_urls::timemap::{Request, Field::{Timestamp, StatusCode, UrlKey}};
let r = Request::builder("nexushq.universe.lego.com/en-us/character/details")
.match_prefix()
.with_field(Timestamp)
.with_field(UrlKey)
.filter_inverted(StatusCode, "[45]..")
.collapse(UrlKey)
.done().to_url();
assert_eq!(&r, "https://web.archive.org/web/timemap/\
?url=nexushq.universe.lego.com%2Fen-us%2Fcharacter%2Fdetails\
&fl=timestamp,urlkey\
&matchType=prefix\
&collapse=urlkey\
&filter=!statuscode:[45]..");