Phishtank API

Crates.io docs.rs Build Status

Phishtank API gives access to phishtank to download the phishtank database or lookup for a url in phishtank database.

Usage

toml [dependencies] phishtank = "0.0.2" and then ```rust use phishtank::PhishtankClient;

// Download the Phishtank Database fn main() { let apikey = match std::env::args().nth(1).okor("Please provide the api key!") { Ok(apikey) => apikey, Err(e) => { println!("{:?}", e); std::process::exit(1) } };

let limit = 5;
let res = PhishtankClient::new(&api_key)
    .user_agent("phishtank/[username]")
    .download_data();

match res {
    Ok(data) => {
        for d in data.iter().take(limit) {
            println!("{:#?}", d)
        }
        println!("Showing {} out of {}", limit, data.len())
    }
    Err(e) => println!("Error: {:?}", e.to_string()),
}

} ```

Examples

Developer reference


License: MIT