Struct diffbot::Diffbot [] [src]

pub struct Diffbot { /* fields omitted */ }

Diffbot API client.

Example

let diffbot = Diffbot::v3("token");
let result = diffbot.call(API::Analyze, "http://diffbot.com");

Methods

impl Diffbot
[src]

Returns a Diffbot client that uses the given token and version.

Valid versions: 1, 2, 3.

Convenient method to use a v1 client.

Convenient method to use a v2 client.

Convenient method to use a v3 client (recommended).

Makes an API call without extra options.

Just calls call_with_options with an empty option list.

Makes an API call

Runs target_url through the diffbot endpoint specified by api. Add each (key,value) pair in options to the query string. Read the diffbot documentation for information on supported values.

Example

diffbot.call_with_options(API::Article,
                          "http://diffbot.com",
                          &[("paging", "false")])

List existing crawls.

Post an entire html body to the API, without extra options.

See call_with_options for information on the arguments.

target_url here is the URL the page would have. It doesn't have to be accessible, but will be used when resolving links.

Example

let body = b"<html>...</html>";
diffbot.post_body(API::Article,
                  "http://my.website.com",
                  body)

Posti an entire html body to the API.

See call_with_options for information on the arguments.

target_url here is the URL the page would have. It doesn't have to be accessible, but will be used when resolving links.

Run a search in a diffbot collection without extra options.

Use col = GLOBAL-INDEX for the global search collection.

Example

diffbot.search("GLOBAL-INDEX", "diffbot")

Run a search in a diffbot collection.

Use col = GLOBAL-INDEX for the global search collection.

Starts a bulk job.

Starts a bulk job called name on the given url list, using api_url on each.

Starts a bulk job with extra options.

Give options a list of (key, value) pairs.

Example

diffbot.bulk_with_options("my_bulk_job", API::Analyze,
                         &["http://my.first.page.com",
                           "https://my.second.page.com"],
                         &[("repeat", "7.0"),
                           ("notifyEmail", "me@example.com")])

Retrieves the result from a bulk job

Starts a crawl job.

Starts a crawl job with extra options.

Give options a list of (key, value) pairs.

Example

diffbot.crawl_with_options("my_crawl_job", API::Analyze,
                           &["http://my.first.page.com",
                             "https://my.second.page.com"],
                           &[("repeat", "7.0"),
                             ("maxHops", "3")])

Retrieves the result from a crawl job.