rustnao 0.1.4

A Rust implementation of a wrapper for the SauceNAO API.
Documentation

RustNAO

A Rust implementation of a wrapper for the SauceNAO API.

Build Status crates.io link

Installation

Add the following to your Cargo.toml file:

[dependencies]
rustnao = "0.1"

Then, add the following to your main.rs file:

extern crate rustnao;

Examples

Here's a simple example:

extern crate rustnao;
use rustnao::{Handler, Sauce};

fn main() {
	let api_key = "your_api_key";
	let file = "https://i.imgur.com/W42kkKS.jpg";

	// Specifying our key, testmode set to 0, only want to see Pixiv and Sankaku using a mask, nothing excluded, no one specific source, and 15 results at most
	let handle = Handler::new(api_key, Some(0), Some([Handler::PIXIV, Handler::SANKAKU_CHANNEL].to_vec()), None, None, Some(15));

	// Set the minimum similiarity to 45.
	handle.set_min_similarity(45);

	// Returns a vector of Sauce objects if successful
	let result : Vec<Sauce> = handle.get_sauce(file).unwrap();

	// Or perhaps you prefer a JSON output
	let result_json : String = handle.get_sauce_as_pretty_json(file).unwrap();
}

See more examples here.

Documentation

Further documentation can be found here. You can also see SauceNAO's API documentation here.

Development

Interested in helping? Found a problem/bug? Let me know!

Thanks

I was inspired by Sagiri, so a huge shoutout to that project. Furthermore, thanks to SauceNAO which provides this amazing functionality for free.