PlagScan
Ruby wrapper for PlagScan plagiarism API
Installation
Add this line to your application's Gemfile:
gem 'plagscan'And then execute:
$ bundle install
Or install it yourself as:
$ gem install plagscan
Supported APIs
Ping
Check if the PlagScan API is available
Plagscan.ping
=> trueToken
Authenticate and fetch access_token to use with other APIs
Plagscan::Token.fetch client_id: '1234', client_secret: 'secret'
=> { access_token: 'secret_token', expires_in: 86400 }Documents
Upload documents to be checked by PlagScan
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
Begin check of document uploaded to PlagScan
Plagscan::Documents.check access_token: 'secret_token', document_id: 1234
=> nilRetrieve results of document scan
Plagscan::Documents.retrieve access_token: 'secret_token', document_id: 1234, mode: 0
=> { ... }See document retrieve documentation for further details
Users
List user details
Plagscan::Users.list access_token: 'secret_token'
=> [{ ... }, { ... }, ...]See user list documentation for further details
Get user details
Plagscan::Users.get access_token: 'secret_token', user_id: 123456
=> { ... }See user get documentation for further details
Development
For details of the PlagScan API see documentation at https://api.plagscan.com/v3docs/
Contributing
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:
$ rspecand
$ rubocopboth succeed
License
The gem is available as open source under the terms of the MIT License.