diffbot 0.1.0

A client library for the Diffbot API
docs.rs failed to build diffbot-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: diffbot-1.0.0

Diffbot API client for Rust

This library allows you to access the Diffbot API from your rust application. You still need a diffbot token (check their trial).

It returns a Json object from rustc_serialize, which is basically a BTreeMap.

Installation

Add to your Cargo.toml:

[dependencies.diffbot]
git = "https://github.com/diffbot/diffbot-rust-client"

And to your main source file:

extern crate diffbot;

Usage

extern crate diffbot;
use diffbot::*;

fn main() {
    let client = Diffbot::v3("insert_your_token_here");
    match client.call(API::Analyze, "http://www.diffbot.com") {
        Ok(result) =>
            println!("{:?}", result),
        Err(Error::Api(code, msg)) =>
            println!("API returned error {}: {}", code, msg),
        Err(err) =>
            println!("Other error: {:?}", err),
    };
}

License

This library is under the MIT license. You can probably use it in your commercial application without complication.