-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.php
More file actions
54 lines (38 loc) · 1.69 KB
/
demo.php
File metadata and controls
54 lines (38 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
@session_start();
require_once 'vendor/autoload.php';
require_once 'src/plagdocs.php';
$config = array(
'default_url' => 'https://api.plagdocs.com/api/v1',
'api_key' => 'API_KEY_HERE',
'api_secret' => 'SECRET_KEY_HERE'
);
// Initialize Plagdocs
$plagdocs = new plagdocs($config);
$response = null;
// REPORTS
if(isset($_GET['check_plagiarism'])) {
$params = [
'report_name'=> 'Untitled Report',
'source_text'=> 'Education is the transmission of knowledge, skills, and character traits and manifests in various forms. Formal education occurs within a structured institutional framework, such as public schools, following a curriculum. Non-formal education also follows a structured approach but occurs outside the formal schooling system, while informal education entails unstructured learning through daily experiences. Formal and non-formal education are categorized into levels, including early childhood education, primary education, secondary education, and tertiary education.' ];
$response = $plagdocs->add_report($params);
}
if(isset($_GET['list_reports'])) {
$params = [];
$response = $plagdocs->list_reports($params);
}
if(isset($_GET['get_report'])) {
$params = ['workspace_id'=> null, 'report_id'=> $_GET['report_id']];
$response = $plagdocs->get_report($params);
}
if(isset($_GET['get_attachment_report'])) {
$params = ['workspace_id'=> null, 'report_id'=> $_GET['report_id']];
$response = $plagdocs->get_attachment_report($params);
}
// WORKSPACE
if(isset($_GET['list_workspaces'])) {
$params = [];
$response = $plagdocs->list_workspaces($params);
}
echo($response);
?>