gsbrs 0.1.0

Provides a client for Google Safe Browsing lookups
Documentation

License Build Status

gsblookup-rs

Rust interface to Google Safe Browsing Lookup API

Documentation

Usage

Available on crates.io

[dependencies]
gsbrs = "*"

Example

Looking up a single URL.

  let key : String = "API KEY HERE".into();
  let url = Url::parse("http://exampleurl.org/").unwrap();

  let gsb = GSBClient::new(key);
  let statuses = gsb.lookup(url).unwrap();

  if statuses.is_empty() {
    println!("Url not found in any of Google's lists");
  } else {
    for status in statuses {
        match status {
            Status::Phishing    => println!("Phishing"),
            Status::Malware     => println!("Malware"),
            Status::Unwanted    => println!("Unwanted"),
            _                   => ()
        }
    }
  }

See examples/ for more.