Skip to content

Bivek/cf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial CloudFactory REST API Wrapper for Ruby

Welcome to CloudFactory, the easiest way to get digitization work done without the hassle of hiring and managing a workforce. Design a task, and we’ll send it to our 3,000+ person highly trained workforce. Our innovative software ensures that you receive desired accuracy at cost.

This Ruby gem wraps our simple REST API to make sending work and receiving results even easier. For further details, you can read our API documentation.

Getting Started

First, you’ll need to initialize an instance of the CloudFactory class with your configuration details. You can find your public and private key on your account page. For example:

config = {
  'public_key'   => 'foo',
  'private_key'  => 'bar,
  'callback_url' => 'http://send.me/results',
}

client = CF::Client.new(config)

That’s it! Now you’re ready to use CloudFactory.

If you’re using Rails, you’ll want to put this in an initializer and store your config in a standard rails config YAML file. An example config/initializers/cloudfactory.rb might contain:

config = YAML.load_file("#{Rails.root}/config/cloudfactory.yml")[Rails.env]

CF = CF::Client.new(config)

Usage

After creating a template on cloudfactory.com, you’ll be able to send work and receive results via our API. To fetch a list of your templates, simply call:

client.templates

Now you’re ready to send data to our workers. Let’s assume you want them to tag a set of two images. Your data might look something like this:

resources = [
  {
    :identifier => 1,
    :image_url  => 'http://images.com/foo',
  },
  {
    :identifier => 2,
    :image_url  => 'http://images.com/bar',
  },
]

To create a task using your template, just call:

CF::Task.create(
  client,
  template_id,
  resources
)

You can find the template ID on the templates page. When your task is complete, CloudFactory will POST your results to the callback URL specified in your initial config. You can read further about this process over on our API documentation.

Copyright © 2007 CloudFactory, Inc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages