bsobbe/ithenticate

一个用于更简单、更快地使用 Ithenticate API 的库,用于检查和预防剽窃

安装次数: 9,022

依赖关系: 0

建议者: 0

安全性: 0

星标: 22

关注者: 3

分支: 19

开放性问题: 5

类型:php-library

v1.0.0 2017-03-29 05:57 UTC

This package is not auto-updated.

Last update: 2024-09-29 09:27:24 UTC


README

一个用于更简单、更快地使用 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 中添加方法使用说明