plagtracker/api-client

There is no license information available for the latest version (0.1.0) of this package.

php client for api.plagtracker.com

Maintainers

Package info

github.com/plagtracker/api-client

pkg:composer/plagtracker/api-client

Statistics

Installs: 1 501

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

0.1.0 2015-05-01 15:38 UTC

This package is not auto-updated.

Last update: 2026-04-29 15:27:08 UTC


README

Api documentation

http://plagtracker.github.io/api-client/

Installation

{
    "require": {
        "plagtracker/api-client": "0.1.*"
    }
}

Usage

Create client

$client = new \Plagtracker\Api\Client('login', 'password');

Add text for checking

$response = $client->addTextForChecking('text');
if($response->isSuccessfully())
{
    $hash = $response->getData();
}
else
{
    echo 'ERROR: ' . $response->getMessage();
}

Add url for checking

$response = $client->addUrlForChecking('http://example.com');
$hash = $response->getData();

Add file for checking

$response = $client->addFileForChecking('/path/to/file');
$hash = $response->getData();

Get text status

$response = $client->getTextStatus($hash);
if($response->isSuccessfully())
{
    $completedPercent = $response->getData();
}
else
{
    echo 'ERROR: ' . $response->getMessage();
}

Get result

if($completedPercent == 100)
{
    $response = $client->getResult($hash);
    if($response->isSuccessfully())
    {
        $result = $response->getData();
    }
    else
    {
        echo 'ERROR: ' . $response->getMessage();
    }
}

Get plagiarism percent

$response = $client->getPlagiarismPercent($hash);
if($response->isSuccessfully())
{
    $plagiarismPercent = $response->getData();
}
else
{
    echo 'ERROR: ' . $response->getMessage();
}

Get text

$response = $client->getText($hash);
if($response->isSuccessfully())
{
    $text = $response->getData();
}
else
{
    echo 'ERROR: ' . $response->getMessage();
}