Menu

#1 Sandbox Support

open
nobody
None
5
2008-01-12
2008-01-12
BLLC
No

Hi,

I'm just setting up my mturk account and have found it necessary to post to the sandbox. As I expect I will want to do this in the future as well, I have written the following modification to the Constructor function which I believe others would benefit from:

/* Constructor */
function MTurkInterface($AccessKey, $SecretKey, $Version = "2006-08-23", $sandbox = null)
{
if (!isset($sandbox)) $sandbox = FALSE;
if ($sandbox == FALSE) {
$this->Service = "AWSMechanicalTurkRequester";
$this->baseURL = "http://mechanicalturk.amazonaws.com/onca/xml";
$this->soapURL = "http://mechanicalturk.amazonaws.com/onca/soap?Service={$this->Service}";
$this->SecretKey = $SecretKey;
$this->AccessKey = $AccessKey;
$this->Version = $Version;
// $this->ResponseGroup = "Minimal";
return(1);
} else if ($sandbox == TRUE) {
$this->Service = "AWSMechanicalTurkRequester";
$this->baseURL = "http://mechanicalturk.sandbox.amazonaws.com/onca/xml";
$this->soapURL = "http://mechanicalturk.sandbox.amazonaws.com/onca/soap?Service={$this->Service}";
$this->SecretKey = $SecretKey;
$this->AccessKey = $AccessKey;
$this->Version = $Version;
return(1);
}
return(0);
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB