Ruby wrapper for PlagScan plagiarism API
Add this line to your application's Gemfile:
gem 'plagscan'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install plagscan
Plagscan.ping
=> true
Plagscan::Token.fetch client_id: '1234', client_secret: 'secret'
=> { access_token: 'secret_token', expires_in: 86400 }
Plagscan::Documents.create access_token: 'secret_token', file: file
=> { documentID: '1234', .... }
N.B. you can also pass through the document as raw text using the text
parameter in place of the file
parameter.
Optional parameters for userID
, textname
, toRepository
and saveOrig
.
See document create documentation
for further details
Plagscan::Documents.check access_token: 'secret_token', document_id: 1234
=> nil
Plagscan::Documents.retrieve access_token: 'secret_token', document_id: 1234, mode: 0
=> { ... }
See document retrieve documentation for further details
Plagscan::Users.list access_token: 'secret_token'
=> [{ ... }, { ... }, ...]
See user list documentation for further details
Plagscan::Users.get access_token: 'secret_token', user_id: 123456
=> { ... }
See user get documentation for further details
For details of the PlagScan API see documentation at https://api.plagscan.com/v3docs/
Bug reports and pull requests are welcome on GitHub at https://github.com/Studiosity/plagscan-ruby.
Note that spec tests are appreciated to minimise regressions. Before submitting a PR, please ensure that:
$ rspec
and
$ rubocop
both succeed
The gem is available as open source under the terms of the MIT License.