whoisthere

Crates.iowhoisthere
lib.rswhoisthere
version0.1.3
sourcesrc
created_at2021-06-28 11:41:46.371407
updated_at2022-04-03 02:06:00.716636
descriptionWHOIS data parsing crate
homepagehttps://github.com/snshn/whoisthere
repositoryhttps://github.com/snshn/whoisthere
max_upload_size
id415726
size34,185
Sunshine (snshn)

documentation

README

whoisthere

WHOIS parsing crate


Usage

use whoisthere::parse_info;

let domain_name: &str = "somesite.co.uk";
let whois_response_file_path_string: String = format!("tests/_data_/{}.txt", &domain_name);
let whois_response_file_path: &Path = Path::new(&whois_response_file_path_string);
let whois_response: String = fs::read_to_string(whois_response_file_path.as_os_str())
    .expect("Something went wrong reading the file");
let domain_props = parse_info(domain_name, &whois_response);

assert_eq!(domain_props.domain_name, "somesite.co.uk");
assert_eq!(domain_props.expiration_date, "2022-05-14T00:00:00Z");
assert_eq!(domain_props.is_registered, true);
assert_eq!(domain_props.is_under_grace_period, false);

License

To the extent possible under law, the author(s) have dedicated all copyright related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

Commit count: 67

cargo fmt