如何使用 Perl SDK 在 Amazon Mechanical Turk 中使用 SetHITTypeNotification?

发布于 2024-09-24 09:48:30 字数 922 浏览 1 评论 0原文

有人使用 Perl Amazon Mechanical Turk SDK 中的 createHITType 函数将通知属性添加到其 HIT 中吗?

我已经设法让一切正常运转。我可以从我的沙盒帐户和实时系统中获取余额。我已经使用示例目录中的各种技术成功创建了新的命中,但我需要启用 SetHITTypeNotification,传递告诉 Amazon 在有人接受/提交命中时通过电子邮件通知我的属性。

我已经检查了 AWS 上的文档,粗略的架构是这样的:

 <Notification>  
  <Destination>[email protected]</Destination>
  <Transport>Email</Transport>  
  <Version>2006-10-31</Version>  
  <EventType>AssignmentAccepted</EventType>
  <EventType>AssignmentSubmitted</EventType>
 </Notification>

我已经通过各种模块进行了一些 grep 查找通知,并发现了 BulkSupport.pm 模块,该模块似乎引用了包含为传递给 createHITType 函数的属性对象中的哈希值。

我还认为它可能是从属性文件中获取这些内容,但我已经专门学习了 Perl 来将 mturk 与另一个项目一起使用,所以我现在很难弄清楚该怎么做。我也对所有模块进行了perldoc'ed,但是从我能找到的内容来看,完全缺乏关于实现通知的文档。

Has anyone used the createHITType function in the Perl Amazon Mechanical Turk SDK to add Notification properties to their HIT?

I've managed to get it all working. I can grab the balance from both my sandbox account and the live system. I've successfully created new hits using the various techniques in the samples dir, but I need to enable SetHITTypeNotification, passing on properties that tell Amazon to notify me by email when someone accepts/submits a hit.

I've checked through the documentation on AWS and the rough schema would be this:

 <Notification>  
  <Destination>[email protected]</Destination>
  <Transport>Email</Transport>  
  <Version>2006-10-31</Version>  
  <EventType>AssignmentAccepted</EventType>
  <EventType>AssignmentSubmitted</EventType>
 </Notification>

I've done some grep'ing through the various modules looking for notification and came across the BulkSupport.pm module that seems to make reference to notifications contained as a hash within a properties object passed to the createHITType function.

I also think that it is taking these from perhaps a properties file, but I've specifically learnt Perl to use mturk along with another project, so I am now stumped to figure out what to do. I perldoc'ed the crap out of all the modules too, but there is a complete lack of documentation on implementing notifications from what I can find.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮坠入山谷 2024-10-01 09:48:30

我在 perl 中找到了一个不需要 XML 结构的解决方案:

my $mturk2 = Net::Amazon::MechanicalTurk->new(serviceUrl=>"prod");
my $result2 = $mturk2->SetHITTypeNotification(
                     HITTypeId    => 'EXAMPLE00000000000EXAMPLE00000',
                     Notification => {
                         Transport => 'Email',
                         Destination => '[email protected]',
                         EventType => 'AssignmentSubmitted',
                         Version => '2006-05-05'
                    },
                    Active       => 'true'
);
print $result->toString;

使用模块:Net::Amazon::MechanicalTurk

I found a solution in perl without the need of the XML structure:

my $mturk2 = Net::Amazon::MechanicalTurk->new(serviceUrl=>"prod");
my $result2 = $mturk2->SetHITTypeNotification(
                     HITTypeId    => 'EXAMPLE00000000000EXAMPLE00000',
                     Notification => {
                         Transport => 'Email',
                         Destination => '[email protected]',
                         EventType => 'AssignmentSubmitted',
                         Version => '2006-05-05'
                    },
                    Active       => 'true'
);
print $result->toString;

using the module: Net::Amazon::MechanicalTurk

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文