Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mkisilenko-test

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkisilenko-test

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Copyleaks Ruby SDK

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

Detect plagiarism using Copyleaks SDK in:

  • Online content and webpages
  • Local and cloud files (see supported files
  • Free text
  • OCR (Optical Character Recognition) - scanning pictures with textual content (see supported files)

Installation

Add this line to your application's Gemfile:

gem 'copyleaks_api'

And then execute:

$ bundle

Or jsut using command:

$ gem install copyleaks_api

Requirements

This gem tested on ruby-1.9.3-p551, jruby-9.0.5.0 and ruby-2.3.0.

Usage

Firstly you need to crate connection with your api-key and email:

cloud = CopyleaksApi::CopyleaksCloud.new(my_email, my_api_key)

After this you can scan you image:

process = cloud.create_by_ocr(path_to_image, language: Copyleaks::Language.english)

Methods create_by_url, create_by_file, create_by_text, status, result and list returns CopyleaksApi::CopyleaksProcess objects. When you want to check changes of it's status you can just reload it:

process.reload
process.finished?

This firstly get new data from Copyleaks and return true if this process now has status Finished.

Configuration

You can specify all necessary configuration in one place just using:

CopyleaksApi::Config do |config|
    config.sanbox_mode = true
    config.allow_partial_scan = true
    config.http_callback = 'http://yoursite.here'
    config.email_callback = 'your@email.com'
    config.custom_fields = { some_field: 'and its value' }
end

Or just call methods:

CopyleaksApi::Config.sandbox_mode = true

Also some parameters can be specified in method arguments.

If you want to disable all callbacks you can pass no_callbak: true optoin to any create method (no_http_callback or no_email_callback to disable only one). no_custom_fields works the same way.

Errors

ClassDescription
BasicErrorSuperclass error for all gem errors
BadCustomFieldErrorGiven custom fields didnt pass validation (key/value/overall size is to large)
BadFileErrorGiven file is too large
BadEmailErrorGiven email for callback is invalid
BadUrlErrorGiven callback url is invalid
UnknownLanguageErrorGiven language for OCR is invalid
BadResponseErrorReponse fro API has not 200 code
ManagedErrorReponse contains manages Copyleaks error code (all list are given here)

##Examples

For fast test you could launch examples/main.rb script. It has a lot of comments so there is no need in additional descriptions. You just need to change email and api_key values.

Read more

FAQs

Package last updated on 29 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc