markpercival-rturk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +35 -2
- metadata +4 -4
data/README.markdown
CHANGED
@@ -17,6 +17,8 @@ You'd be better off with amazon's official library, in all its XML cruftiness.
|
|
17
17
|
|
18
18
|
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.
|
19
19
|
|
20
|
+
### Creating HIT's
|
21
|
+
|
20
22
|
require 'rturk'
|
21
23
|
|
22
24
|
props = {:Title=>"Add tags to an item",
|
@@ -39,6 +41,37 @@ Let's say you have a form at "http://myapp.com/turkers/add_tags" where Turkers c
|
|
39
41
|
page = RTurk::ExternalQuestionBuilder.build(
|
40
42
|
"http://myapp.com/turkers/add_tags", :item_id => '1234')
|
41
43
|
|
42
|
-
# Turkers will be directed to http://myapp.com/turkers/add_tags?item_id=1234
|
44
|
+
# Turkers will be directed to http://myapp.com/turkers/add_tags?item_id=1234&AssignmentId=abcd12345
|
45
|
+
|
46
|
+
p @turk.create_hit(props, page)
|
47
|
+
|
48
|
+
### Reviewing HIT's
|
49
|
+
|
50
|
+
require 'rturk'
|
51
|
+
@turk = RTurk::Requester.new(AWSAccessKeyId, AWSAccessKey, :sandbox => true)
|
52
|
+
|
53
|
+
p @turk.getAssignmentsForHIT(:HITId => 'abcde1234567890')
|
54
|
+
|
55
|
+
## Nitty Gritty
|
56
|
+
|
57
|
+
Here's a quick peak at what happens on the Mechanical Turk side.
|
58
|
+
|
59
|
+
A worker takes a look at your hit. The page will contain an iframe with your external URL loaded inside of it.
|
60
|
+
|
61
|
+
Amazon will append the AssignmentID parameter to the URL for your own information. In preview mode this will look like
|
62
|
+
http://myapp.com/turkers/add_tags?item_id=1234&AssignmentId=ASSIGNMENT_ID_NOT_AVAILABLE
|
63
|
+
|
64
|
+
If the Turker accepts the HIT, the page will reload and the iframe URL will resemble
|
65
|
+
|
66
|
+
http://myapp.com/turkers/add_tags?item_id=1234&AssignmentId=1234567890123456789ABC
|
67
|
+
|
68
|
+
The form in your page MUST CONTAIN the AssignmentID in a hidden input element. You could do this on the server side with a rails app, or on the client side with javascript(check the examples)
|
43
69
|
|
44
|
-
|
70
|
+
Anything submitted in this form will be sent to Amazon and saved for your review later.
|
71
|
+
|
72
|
+
## More information
|
73
|
+
|
74
|
+
Take a look at the [Amazon MTurk developer docs](http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMechanicalTurkRequester/) for more information. They have a complete list of API operations, all of which can be called with this library.
|
75
|
+
|
76
|
+
|
77
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markpercival-rturk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Percival
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.0.12
|
34
34
|
version:
|
35
|
-
description:
|
35
|
+
description: Mechanical Turk API wrapper - super simple
|
36
36
|
email: mark@markpercival.us
|
37
37
|
executables: []
|
38
38
|
|
@@ -42,7 +42,7 @@ extra_rdoc_files: []
|
|
42
42
|
|
43
43
|
files:
|
44
44
|
- README.markdown
|
45
|
-
has_rdoc:
|
45
|
+
has_rdoc: false
|
46
46
|
homepage: http://github.com/markpercival/rturk
|
47
47
|
post_install_message:
|
48
48
|
rdoc_options: []
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: "
|
62
|
+
version: "1.3"
|
63
63
|
version:
|
64
64
|
requirements: []
|
65
65
|
|