Uma biblioteca para usar a API iThenticate de forma mais fácil e rápida, para verificar e prevenir plágio.
Você pode instalar via gerenciador de pacotes do compositor com o seguinte comando:
composer.phar require bsobbe/ iThenticate "*"
Ou adicione o seguinte ao seu arquivo compositor.json :
"require": {
"bsobbe/ iThenticate ": "*"
},
Assim que a instalação for concluída, basta usar a biblioteca com:
use bsobbe iThenticate iThenticate ;
Você poderá usar a biblioteca criando uma instância da classe iThenticate
, certifique-se de passar seu nome de usuário e senha da API iThenticate para o construtor (você pode precisar de SSL para se conectar à API):
$ iThenticate = new iThenticate ( " Your username " , " Your password " );
Afinal, basta chamar cada método que deseja usar passando os parâmetros necessários e a biblioteca cuidará do resto.
Eu sugiro fortemente a leitura do Guia da API iThenticate antes de usar a biblioteca e seus métodos.
Aqui está um exemplo simples para enviar um novo documento:
$ 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).
);
$ iThenticate = new bsobbe iThenticate iThenticate ( " username " , " password " );
$ result = $ iThenticate -> documentGetRequest ( 12345 );
// Since we are requesting 1 document, there should be 1 document only in the response.
$ document = reset ( $ result [ ' documents ' ]);
$ is_pending = $ document [ ' is_pending ' ]; // If the report is pending.
$ document_id = $ document [ ' id ' ];
$ processed_time = $ document [ ' processed_time ' ]; // The time the report has been created.
$ percent_match = $ document [ ' percent_match ' ]; // The percentage match for the document.
$ title = $ document [ ' title ' ]; // The submitted title of the document.
$ uploaded_time = $ document [ ' uploaded_time ' ]; // The time the document was uploaded.
// Also, $document['folder'] is available containing information related to the folder that the document is submitted
// into.
$ iThenticate = new bsobbe iThenticate iThenticate ( " username " , " password " );
$ result = $ iThenticate -> reportGetRequest ( 98765 , 1 , 1 , 1 ); // The report ID.
$ view_only_url = $ result [ ' view_only_url ' ];
$ view_only_expires = $ result [ ' view_only_expires ' ];
$ report_url = $ result [ ' report_url ' ];
Sinta-se à vontade para contribuir e adicionar novos métodos baseados no API Guide do iThenticate
Adicione instruções de uso do método em ReadMe.md