Giter Site home page Giter Site logo

angelxmoreno / php-plagiarism-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from copyleaks/php-plagiarism-checker

0.0 3.0 0.0 2.34 MB

Copyleaks detects online plagiarism and checks content distribution. Use Copyleaks to find out if textual content is original and where it has been used before. This example in PHP shows how to integrate with the Copyleaks cloud to search for copyright infringement.

Home Page: https://api.copyleaks.com

License: MIT License

PHP 100.00%

php-plagiarism-checker's Introduction

Copyleaks PHP SDK

Copyleaks SDK is a simple framework that allows you to scan text for plagiarism and detect content distribution online, using the Copyleaks plagiarism checker cloud.

Using Copyleaks SDK you can detect plagiarism in:

Installation

Integrate with the Copyleaks SDK in one of two options:

  • Recommended: Use the Package Manager - Packagist.
    When integrating that way you will automatically be able to update the SDK to its latest version:
    composer require copyleaks/php-plagiarism-checker @dev
    
    Following that, in order to use the SDK, add this to your code:
    //copyleaks dependencies 
    include_once( __DIR__.'/vendor/copyleaks/php-plagiarism-checker/autoload.php');
    use Copyleaks\CopyleaksCloud;
    use Copyleaks\CopyleaksProcess;
    
  • Download the code from this repository and add it to your project.

Register and Get Your API Key

To use the Copyleaks API you need to first have a Copyleaks account. The registration to Copyleaks takes a minute and is free of charge. Signup and confirm your account to finalize your registration.

You can generate your personal API key. Do so by entering your dashboard (Businesses dashboard/Academic dashboard/Websites dashboard), and under 'Access Keys' you will be able to see and generate your API keys.

For more information check out our API guide.

Examples

See example_asynchronous.php for an example using callbacks and example_synchronous.php for a synced example that update the status programatically.

Usage

To scan for plagiarism the URL: 'https://www.copyleaks.com'. All you have to do is to update the following two lines with your email and API key:

$email = 'Your-Email-Address-Here';
$apiKey = 'Your-API-Key-Here';

Add this additional header to get a completion callback:

$additionalHeaders = array($clConst['HTTP_CALLBACK'].': http://your.website.com/callbacks/' 

For testing purposes you can use http://requestb.in


Create a process using createByUrl:

$process  = $clCloud->createByURL('https://www.copyleaks.com',$additionalHeaders); 

Available create methods are: createByURL, createByFile, createByFiles, createByOCR and createByText.

If you don't want to use callbacks you can wait for the scan to complete:

while ($process->getStatus() != 100){
	sleep(2);              
}

And get the results:

$results = $process->getResult();
// Print the results
foreach ($results as $result) {
	echo $result;
}

Configuration

You can set specific headers:

$additionalHeaders = array(
  $clConst['SANDBOX_MODE_HEADER'], // Sandbox mode - Scan without consuming any credits and get back dummy results
  $clConst['HTTP_CALLBACK'].': http://your.website.com/callbacks/', # For a fast testing of callbacks option we recommend to use http://requestb.in
  $clConst['IN_PROGRESS_RESULT'].': http://your.website.com/callback/results/,
  $clConst['EMAIL_CALLBACK'].': [email protected]',
  $clConst['CLIENT_CUSTOM_PREFIX'].'name: some name'
  $clConst['PARTIAL_SCAN_HEADER'],
  $clConst['COMPARE_ONLY'] # Compare files in between - available only on createByFiles
  $clConst['IMPORT_FILE_TO_DATABASE'] # Import your file to our database only
  );

For more info about the optional headers see API Request Headers

Read More

php-plagiarism-checker's People

Contributors

eladbitton avatar yehonatanb avatar mkisilenko avatar

Watchers

Angel S. Moreno avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.