classify

Run a set of URLs through the eContext API and return classifications.

Description

public eContext\Classify\Results\Html Url::classify( [$concurrency = 1 [, $params = array() ]] )

Parameters

$concurrency
An optional parameter that specifies how many concurrent asynchronous calls should be run at once.
$params
A list of key=>value pairs describing Parameters to be included with the eContext API call.

Return Values

Returns a eContext\Classify\Results\Html object containing classifications for the URLs specified for this run.

Note

URL classification shares the same eContext\Classify\Results\Html class as HTML classification.

Examples

Example #1

Classify a list URLs in parallel using two concurrent calls.

$urls = [
    'https://www.econtext.ai',
    'http://www.cnn.com/',
    'http://www.bbc.com/sport'
];
$client = new eContext\Client(ECONTEXT_USERNAME, ECONTEXT_PASSWORD);
$classify = new eContext\Classify\Url($client);
$classify->setData($urls);
$results = $classify->classify(2);