02/05
2015
php client for api.plagtracker.com
http://plagtracker.github.io/api-client/, (*1)
{ "require": { "plagtracker/api-client": "0.1.*" } }
$client = new \Plagtracker\Api\Client('login', 'password');
, (*2)
$response = $client->addTextForChecking('text'); if($response->isSuccessfully()) { $hash = $response->getData(); } else { echo 'ERROR: ' . $response->getMessage(); }
, (*3)
$response = $client->addUrlForChecking('http://example.com'); $hash = $response->getData();
, (*4)
$response = $client->addFileForChecking('/path/to/file'); $hash = $response->getData();
, (*5)
$response = $client->getTextStatus($hash); if($response->isSuccessfully()) { $completedPercent = $response->getData(); } else { echo 'ERROR: ' . $response->getMessage(); }
, (*6)
if($completedPercent == 100) { $response = $client->getResult($hash); if($response->isSuccessfully()) { $result = $response->getData(); } else { echo 'ERROR: ' . $response->getMessage(); } }
, (*7)
$response = $client->getPlagiarismPercent($hash); if($response->isSuccessfully()) { $plagiarismPercent = $response->getData(); } else { echo 'ERROR: ' . $response->getMessage(); }
, (*8)
$response = $client->getText($hash); if($response->isSuccessfully()) { $text = $response->getData(); } else { echo 'ERROR: ' . $response->getMessage(); }
, (*9)