Skip to content

Copyleaks finds plagiarism online using copyright infringement detection technology. Find those who have used your content with Copyleaks. See here how to integrate Copyleaks easily with your services, using Java, to detect plagiarism.

License

Notifications You must be signed in to change notification settings

Israel4Ever/Java-Plagiarism-Checker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copyleaks SDK

Copyleaks SDK is a simple framework that allows you to perform plagiarism scans and track content distribution around the web, using the Copyleaks cloud.

With the Copyleaks SDK you can submit a scan for:

  • Webpages
  • Local files - pdf, doc, docx, rtf and more (see full list)
  • Free text
  • OCR (Optical Character Recognition) - scanning pictures containing textual content (see full list)
Instructions for using the SDK are below. For a quick example demonstrating the SDK capabilities just look at the code examples under “examples”.

Integration

You can integrate with the Copyleaks SDK in one of two ways:

  • Download the code to your workspace – choose this option if you want to alter the code and add capabilities to match your own specific needs. Download the project from here, open it using Eclipse and choose ‘Import Project’ from your own workspace. Then, follow the next steps:
    1. Go to ‘General’, choose ‘Existing projects into workspace’ and press next.
    2. Fill in the details about the project you just downloaded under ‘Select root directory’.
    3. Make sure that the project Copyleaks API is checked.
    4. Press ‘Finish’.

    Now you have the project in your workspace and you can make alterations that fits your own specific needs. As default, the project includes the file ‘Main.java’. This file will allow you to easily run and check your project.

  • Download the JAR files – choose this option if you want to use the code as-is. Download the JAR files and then, follow the next steps:
    1. Extract the files.
    2. Open Eclipse and select the process you want to integrate with Copyleaks API.
    3. Press the right mouse key and choose ‘Build Path’ -> ‘Configure Build Path’.
    4. In the window that opened choose the tab ‘Libraries’.
    5. Press on ‘Add External JAR’.
    6. Browse the libraries with your extracted JAR files and choose to add them.

Now you can use the Copyleaks API in your project. If you are working with our latest version, you can also run the libraries using the code found down on this page.

Signing Up and Getting Your API Key

To use Copyleaks API you need to be a registered user. Signing up is quick and free of charge.

Signup to Copyleaks and confirm your account by clicking the link in the confirmation email. Generate your personal API key on your dashboard (Businesses dashboard/Academic dashboard/Websites dashboard) under 'Access Keys'.

For more information check out our API guide.

Example

This code will show you where the textual content in the parameter ‘url’ has been used online:

public static void Scan(String email, String key, String url) {
	CopyleaksCloud copyleaks = new CopyleaksCloud();
	try {
		System.out.print("Login to Copyleaks cloud...");
		copyleaks.Login(email, key);
		System.out.println("Done!");
	System.out.print("Checking account balance...");
	int creditsBalance = copyleaks.getCredits();
	System.out.println("Done (" + creditsBalance + " credits)!");
	if (creditsBalance == 0) {
		System.out.println(
				"ERROR: You do not have enough credits left in your account to proceed with this scan! 							(current credit balance = "+ creditsBalance + ")");
		return;
	}

	ProcessOptions scanOptions = new ProcessOptions();
	// scanOptions.setSandboxMode(true); // <------ Read more @
	// https://api.copyleaks.com/Documentation/RequestHeaders#sandbox-mode

	ResultRecord[] results;
	CopyleaksProcess createdProcess;

	createdProcess = copyleaks.CreateByUrl(new URI(url), scanOptions);

	// Waiting for process completion...
	System.out.println("Scanning...");
	int percents = 0;
	while (percents != 100 && (percents = createdProcess.getCurrentProgress()) <= 100) {
		System.out.println(percents + "%");

		if (percents != 100)
			Thread.sleep(4000);
	}

	results = createdProcess.GetResults();

	if (results.length == 0) {
		System.out.println("No results.");
	} else {
		for (int i = 0; i < results.length; ++i) {
			System.out.println();
			System.out.println(String.format("Result %1$s:", i + 1));
			System.out.println(String.format("Url: %1$s", results[i].getURL()));
			System.out.println(String.format("Percents: %1$s", results[i].getPercents()));
			System.out.println(String.format("CopiedWords: %1$s", results[i].getNumberOfCopiedWords()));
		}
	}
} catch (CommandFailedException copyleaksException) {
	System.out.println("Failed!");
	System.out.format("*** Error (%d):\n", copyleaksException.getCopyleaksErrorCode());
	System.out.println(copyleaksException.getMessage());
} catch (Exception ex) {
	System.out.println("Failed!");
	System.out.println("Unhandled Exception");
	System.out.println(ex);
}

}

Dependencies:

Referenced Assemblies:

Read More

About

Copyleaks finds plagiarism online using copyright infringement detection technology. Find those who have used your content with Copyleaks. See here how to integrate Copyleaks easily with your services, using Java, to detect plagiarism.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%