iThenticate
Basic API methods
iThenticate API をより簡単かつ迅速に使用して、盗作をチェックして防止するためのライブラリ。
次のコマンドを使用して、 composerパッケージ マネージャー経由でインストールできます。
composer.phar require bsobbe/ iThenticate "*"
または、 composer.jsonファイルに以下を追加します。
"require": {
"bsobbe/ iThenticate ": "*"
},
インストールが完了したら、次のようにしてライブラリを使用します。
use bsobbe iThenticate iThenticate ;
iThenticate
クラスのインスタンスを作成することでライブラリを使用できるようになります。必ずiThenticate API のユーザー名とパスワードをコンストラクターに渡してください (API に接続するには SSL が必要な場合があります)。
$ iThenticate = new iThenticate ( " Your username " , " Your password " );
結局のところ、必要なパラメータを渡して使用したい各メソッドを呼び出すだけで、残りはライブラリが処理してくれます。
ライブラリとそのメソッドを使用する前に、 iThenticate API ガイドを読むことを強くお勧めします。
新しいドキュメントを送信する簡単な例を 1 つ示します。
$ 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 ' ];
iThenticateの API ガイドに基づいて、自由に貢献したり、新しいメソッドを追加したりできます
ReadMe.md にメソッドの使用手順を追加