-
-
Save zeeshanlakhani/1323663 to your computer and use it in GitHub Desktop.
make a mechanical turk job with boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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