smnirven.biomass

https://github.com/smnirven/biomass.git

git clone 'https://github.com/smnirven/biomass.git'

(ql:quickload :smnirven.biomass)
14

biomass

Det. Thorn: “Who bought you?”

Hatcher: “You're bought as soon as they pay you a salary.”

Soylent Green

Drive Amazon Mechanical Turk from your Clojure apps.

biomass is an implementation of the Amazon Web Services Mechanical Turk REST API in clojure.

Build Status

Build Status Dependency Status

Kudos

Kudos to Robert Boyd for the original implementation and inspiration

Installation

biomass is available as a Maven artifact from Clojars

Clojars Project

Configuration

Before making any requests, be sure to set your AWS credentials

(biomass.request/setup {:AWSAccessKey    "deadbeef"
                        :AWSSecretAccessKey "cafebabe"})

Whilst testing, you may find it useful to route all your requests to the AWS Mechanical Turk Sandbox environment.

(biomass.request/setup {:AWSAccessKey    "deadbeef"
                        :AWSSecretAccessKey "cafebabe"
                        :sandbox true})

Usage

Amazon Mechanical Turk allocates jobs to humans in the form of “Human Intelligence Tasks” or “HITs”.

First create a HIT type and Layout using the Requester UI.

Example of creating a HIT:

(let [hit-type-id     "VCZVWLDJOTFFJXXQLGXZ"
      hit-layout-id   "WMYUHDBKJKNGOAMNCNMT"
      10-minutes      (* 10 60)
      1-day           (* 24 60 60)]
  (biomass.hits/create-hit {:hit-type-id hit-type-id
                            :hit-layout-id hit-layout-id 
                            :assignment-duration 10-minutes
                            :lifetime 1-day
                            :layout-params {:layout-parameter1 "This is a variable defined in the layout"
                                            :layout-parameter2 "This is another"}})

Check out the wiki for more usage examples

License

Copyright © 2014 Thomas Steffes

Distributed under the Eclipse Public License, the same as Clojure.