iThenticate
Basic API methods
一个使用iThenticate API 更轻松、更快速地检查和防止抄袭的库。
您可以使用以下命令通过Composer包管理器进行安装:
composer.phar require bsobbe/ iThenticate "*"
或者将以下内容添加到您的composer.json文件中:
"require": {
"bsobbe/ iThenticate ": "*"
},
安装完成后,只需使用该库即可:
use bsobbe iThenticate iThenticate ;
您将能够通过创建iThenticate
类的实例来使用该库,请确保将您的iThenticate API用户名和密码传递给构造函数(您可能需要 SSL 来连接到 API):
$ iThenticate = new iThenticate ( " Your username " , " Your password " );
毕竟,只需调用您想要使用的每个方法并传递所需的参数,库就会处理剩下的事情。
我强烈建议在使用该库及其方法之前阅读iThenticate API 指南。
这是发送新文档的一个简单示例:
$ 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中添加方法使用说明