Git Product home page Git Product logo

vuzitruby's Introduction

= VuzitRuby - Vuzit Web Services library

== INTRODUCTION

This is a library that allows developers to directly access the Vuzit Web 
Service API through a simple Ruby script:

http://vuzit.com/developer/web_service_api

Below is a basic upload example:

  require "vuzitruby"  

  Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
  Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'

  doc = Vuzit::Document.upload("c:/path/to/document.pdf")

  puts "Document id: " + doc.id  

To get started all you need to do is download the code, sign up for a free 
account (https://ssl.vuzit.com/signup) and replace the public and 
private keys with the keys from your account.

== SETUP

The client library is a RubyGem called *vuzitruby*. To install, type:

  gem install vuzitruby

== GETTING STARTED 

* Download the code - http://github.com/vuzit/vuzitruby/downloads
* Sign up for a free Vuzit account - https://ssl.vuzit.com/signup
* Code Examples - http://wiki.github.com/vuzit/vuzitruby/code_examples
* Vuzit API Reference - http://wiki.github.com/vuzit/vuzitruby/api_reference
* VuzitCL Command Line - http://wiki.github.com/vuzit/vuzitruby/vuzitcl

== EXAMPLES

Find Document Example - how to load a document:

  require "vuzitruby"

  Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
  Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'

  doc = Vuzit::Document.find("DOCUMENT_ID")

  puts "Document id: " + doc.id
  puts "Document title: " + doc.title

Delete (destroy) Document Example:

  require "vuzitruby"  

  Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
  Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'

  doc = Vuzit::Document.destroy("DOCUMENT_ID")

Upload and View with the JavaScript API Example for a Rails RHTML file:

  <%
  require "vuzitruby"
  require 'cgi'

  Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
  Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'

  doc = Vuzit::Document.upload("c:/path/to/document.pdf")
  timestamp = Time.now
  sig = Vuzit::Service.signature("show", doc.id, timestamp)
  %>
  <html>
    <head>
      <link href="http://vuzit.com/stylesheets/Vuzit-2.9.css" rel="Stylesheet" type="text/css" />
      <script src="http://vuzit.com/javascripts/Vuzit-2.9.js" type="text/javascript"></script>
      <script type="text/javascript">
        // Called when the page is loaded.  
        function initialize()  {
          vuzit.Base.apiKeySet("<%= Vuzit::Service.public_key %>"); 
          var options = {signature: '<%= CGI.escape(sig) %>', 
                         timestamp: '<%= timestamp %>', ssl: true}
          var viewer = vuzit.Viewer.fromId("<%= doc.id %>", options);
          
          viewer.display(document.getElementById("vuzit_viewer"), { zoom: 1 });
        }
      </script>
    </head>
    <body onload="initialize()">
      <div id="vuzit_viewer" style="width: 650px; height: 500px;"></div>
    </body>
  </html>

== LICENSE

Copyright (c) 2009-2010 Brent Matzelle, Vuzit LLC 

Released under the MIT license: 

http://www.opensource.org/licenses/mit-license.php

This means you can use it in proprietary products. See LICENSE file.

vuzitruby's People

Contributors

bmatzelle avatar

Watchers

 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.