Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Readme.md

Diffbot API client for Rust

Build Status crates.io

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 serde_json.

Documentation

Installation

Add to your Cargo.toml dependencies:

[dependencies]
diffbot = "1.0"

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),
    };
}
extern crate diffbot;
use diffbot::*;

fn main() {
	let client = Diffbot::v3("insert_your_token_here");
	match client.search("GLOBAL-INDEX", "type:article diffbot") {
        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.

About

A rust client library for the DiffbotAPI

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.