Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
RTurk - A simple wrapper and library for Amazon's Mechanical Turk
branch: master

This branch is 248 commits behind ryantate:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
spec
.gitignore
README.markdown
rturk.gemspec

README.markdown

RTurk - A ridiculously simple Mechanical Turk library in Ruby

What's it do?!?

RTurk is designed to fire off Mechanical Turk tasks for pages that reside on a external site.

The pages could be a part of a rails app, or just a simple javascript enabled form.

If you want to build forms that are hosted on Mechanical Turk, this is not the library you need. You'd be better off with amazon's official library, in all its XML cruftiness.

Installation

sudo gem install markpercival-rturk --sources http://gems.github.com

Use

Let's say you have a form at "http://myapp.com/turkers/add_tags" where Turkers can add some tags to items in your catalogue.

require 'rturk'

props = {:Title=>"Add tags to an item", 
         :MaxAssignments=>1, :LifetimeInSeconds=>3600, 
         :Reward=>{:Amount=>0.05, :CurrencyCode=>"USD"}, 
         :Keywords=>"twitter, blogging, writing, english", 
         :Description=>"Simply add some tags for me",
         :RequesterAnnotation=>"Example1",
         :AssignmentDurationInSeconds=>3600, :AutoApprovalDelayInSeconds=>3600, 
         :QualificationRequirement=>[{
           # Approval rate of greater than 90%
           :QualificationTypeId=>"000000000000000000L0", 
           :IntegerValue=>90, 
           :Comparator=>"GreaterThan", 
           :RequiredToPreview=>"false"
           }]
        }

@turk = RTurk::Requester.new(AWSAccessKeyId, AWSAccessKey, :sandbox => true)
page = RTurk::ExternalQuestionBuilder.build(
  "http://myapp.com/turkers/add_tags", :item_id => '1234')

# Turkers will be directed to http://myapp.com/turkers/add_tags?item_id=1234

p @turk.create_hit(props, page)
Something went wrong with that request. Please try again.