Eine Bibliothek zur einfacheren und schnelleren Nutzung iThenticate API, um Plagiate zu überprüfen und zu verhindern.
Sie können über den Composer- Paketmanager mit dem folgenden Befehl installieren:
composer.phar require bsobbe/ iThenticate "*"
Oder fügen Sie Folgendes zu Ihrer Composer.json- Datei hinzu:
"require": {
"bsobbe/ iThenticate ": "*"
},
Sobald die Installation abgeschlossen ist, verwenden Sie die Bibliothek einfach mit:
use bsobbe iThenticate iThenticate ;
Sie können die Bibliothek verwenden, indem Sie eine Instanz der iThenticate
-Klasse erstellen. Stellen Sie sicher, dass Sie Ihren iThenticate -API- Benutzernamen und Ihr Kennwort an den Konstruktor übergeben (möglicherweise benötigen Sie SSL, um eine Verbindung zur API herzustellen):
$ iThenticate = new iThenticate ( " Your username " , " Your password " );
Schließlich rufen Sie einfach jede Methode auf, die Sie verwenden möchten, indem Sie die erforderlichen Parameter übergeben, und die Bibliothek kümmert sich um den Rest.
Ich empfehle dringend, den iThenticate API Guide zu lesen, bevor Sie die Bibliothek und ihre Methoden verwenden.
Hier ist ein einfaches Beispiel zum Senden eines neuen Dokuments:
$ 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 ' ];
Fühlen Sie sich frei, einen Beitrag zu leisten und neue Methoden basierend auf dem API-Leitfaden von iThenticate hinzuzufügen
Fügen Sie Anweisungen zur Methodenverwendung in ReadMe.md hinzu