package mturk_test import ( "fmt" "github.com/goamz/goamz/aws" "github.com/goamz/goamz/exp/mturk" ) var turk *mturk.MTurk func ExampleNew() { // These are your AWS tokens. Note that Turk do not support IAM. // So you'll have to use your main profile's tokens. var auth = aws.Auth{AccessKey: "", SecretKey: ""} turk = mturk.New(auth, true) // true to use sandbox mode } func Examplemturk_CreateHIT_withExternalQuestion() { question := mturk.ExternalQuestion{ ExternalURL: "http://www.amazon.com", FrameHeight: 200, } reward := mturk.Price{ Amount: "0.01", CurrencyCode: "USD", } hit, err := turk.CreateHIT("title", "description", question, reward, 30, 30, "key1,key2", 3, nil, "annotation") if err == nil { fmt.Println(hit) } } func Examplemturk_CreateHIT_withHTMLQuestion() { question := mturk.HTMLQuestion{ HTMLContent: mturk.HTMLContent{`

What's up?

]]>`}, FrameHeight: 200, } reward := mturk.Price{ Amount: "0.01", CurrencyCode: "USD", } hit, err := turk.CreateHIT("title", "description", question, reward, 30, 30, "key1,key2", 3, nil, "") if err == nil { fmt.Println(hit) } }