Skip to content

Instantly share code, notes, and snippets.

@zeeshanlakhani
Forked from aparrish/make_turk_job.py
Created October 28, 2011 21:47
Show Gist options
  • Save zeeshanlakhani/1323663 to your computer and use it in GitHub Desktop.
Save zeeshanlakhani/1323663 to your computer and use it in GitHub Desktop.
make a mechanical turk job with boto
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