PHP iThenticate
A library to use iThenticate API easier and faster, to check and prevent plagiarism.
You can install via composer package manager with the following command:
composer.phar require bsobbe/ithenticate "*"
Or add the following to your composer.json file:
"require": {
"bsobbe/ithenticate": "*"
},
Once the installation is completed, simply use the library with:
use bsobbe\ithenticate\Ithenticate;
You will be able to use the library by creating instace of the Ithenticate
class, make sure you pass your iThenticate API username and password to the constructor (You might need SSL to connect to the API):
$ithenticate = new Ithenticate("Your username", "Your password");
After all simply call each method you want to use with passing the required parameters, and the library will take care of the rest.
I strongly suggest to read the iThenticate API Guide before using the library and its methods.
Here is one simple example to send new document:
$ithenticate = new \bsobbe\ithenticate\Ithenticate("username", "password");
//The value in result variable is the document_id of the inserted document.
$result = $ithenticate->submitDocument(
"Cloud Computing",
"Sobhan",
"Bagheri",
"CloudComputingEssay.pdf", //File name from the object of the uploaded temp file.
$content, //Document content fetched with php file_get_contents() function from the document file.
649216 //Folder number to store document (You can get folder number from last part of ithenticate panel URL).
);
Feel free to contribute and add new methods based on ithenticate's API Guide
Add method usage instructions in ReadMe.md