Created — forked from aparrish/make_turk_job.py

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

make a mechanical turk job with boto

View make_turk_job.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import boto.mturk
import boto.mturk.connection
import boto.mturk.price
from boto.mturk.question import *
import sys
 
question = QuestionForm([
Question(
identifier=1,
content=QuestionContent([
SimpleField("Text", "what's that blue thing doing here?")
]),
answer_spec=AnswerSpecification(FreeTextAnswer())
)
])
 
print question.get_as_xml()
 
mturk = boto.mturk.connection.MTurkConnection(
aws_access_key_id='<your access key idea>',
aws_secret_access_key='<your secret access key>',
host='mechanicalturk.sandbox.amazonaws.com'
)
 
rs = mturk.create_hit(
question=question,
title='fingertips',
description='This is a test thing',
reward=boto.mturk.price.Price(0.01),
max_assignments=100,
duration=60
)
 
for hit in rs:
print hit
print hit.HITId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.