get_analyse: Get data about a URL from Diffbot, using the analyse API

Description Usage Arguments Value Examples

View source: R/diffbot.R

Description

Get data for a URL from the analyse API. For more information see Diffbot's documenation.

Usage

1
2
get_analyse(url, api_key, mode = NULL, fallback = NULL, fields = NULL,
  discussion = TRUE, timeout = NULL, callback = NULL)

Arguments

url

The URL to analyse.

api_key

Your API key (also called token in the diffbot documenation).

mode

Setting to NULL uses the analyse API, where Diffbot tries to dermine the page type and analyse accordingly. Other options are: 'article', 'discussion', 'image', 'product' or 'video'.

fallback

If analyse API can't find the correct page type it will use this as a default. Options are: 'article', 'discussion', 'image', 'product' or 'video'.

fields

Depends on the API used. See each APIs documatation page for details.

discussion

Set to FALSE to not extract comments for articles and products.

timeout

How long to wait before timing out request for URL's content.

callback

Used for jsonp requests. See documentation.

Value

An object of class 'diffbot_api'; a list of information returned from Diffbot.

Examples

1
2
3
4
5
6
7
8
## Not run: 
api_key <- '12345'
url <- 'http://techcrunch.com/2012/05/31/diffbot-raises-2-million-seed-round-for-web-content-extraction-technology/'

get_diffbot(url, api_key)
get_diffbot(url, api_key, fallback = 'article', discussion = FALSE)

## End(Not run)

mhairi/diffbotr documentation built on May 22, 2019, 8:56 p.m.