No description, website, or topics provided.
PHP
Latest commit 10883fd May 2, 2015 @kufd kufd update documentation
Permalink
Failed to load latest commit information.
doc update documentation May 1, 2015
library/Plagtracker/Api update documentation May 1, 2015
.gitignore first commit Apr 24, 2015
README.md update documentation May 2, 2015
apidoc.json update documentation May 1, 2015
composer.json first commit Apr 24, 2015

README.md

PHP client for api.plagtracker.com

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();
}