# Parses the GetHIT Response # # # # # 49341251-fcbd-45c3-ab98-8fbe2e4d8060 # # # # True # # GR4R3HY3YGBZXDCAPJWZ # YGKZ2W5X6YFZ08ZRXXZZ # 2009-06-25T04:21:17Z # Write a twitter update # Simply write a twitter update for me # <ExternalQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd"> # <ExternalURL>http://s3.amazonaws.com/mpercival.com/newtweet.html?id=foo</ExternalURL> # <FrameHeight>400</FrameHeight> # </ExternalQuestion> # # twitter, blogging, writing, english # Reviewable # 1 # # 0.10 # USD # $0.10 # # 3600 # 2009-06-25T05:21:17Z # 3600 # 0 # OptionalNote # # 000000000000000000L0 # GreaterThan # 90 # 0 # # NotReviewed # # module RTurk class GetHITResponse < Response attr_reader :hit_id, :type_id, :status, :review_status, :title, :created_at, :expires_at, :assignments_duration, :reward_amount, :max_assignments, :auto_approval_delay, :keywords def initialize(response) @raw_xml = response.body @xml = Nokogiri::XML(@raw_xml) raise_errors map_content(@xml.xpath('//HIT'), :hit_id => 'HITId', :type_id => 'HITTypeId', :keywords => 'Keywords', :status => 'HITStatus', :review_status => 'HITReviewStatus', :title => 'Title', :created_at => 'CreationTime', :expires_at => 'Expiration', :assignments_duration => 'AssignmentDurationInSeconds', :reward_amount => 'Reward/Amount', :max_assignments => 'MaxAssignments', :auto_approval_delay => 'AutoApprovalDelayInSeconds', :description => 'Description', :reward => 'Reward', :lifetime => 'LifetimeInSeconds', :annotation => 'RequesterAnnotation', :similar_hits_count => 'NumberOfSimilarHITs', :assignments_pending_count => 'NumberofAssignmentsPending', :assignments_available_count => 'NumberofAssignmentsAvailable', :assignments_completed_count => 'NumberofAssignmentsCompleted' ) @keywords = @keywords.split(', ') if @keywords end end end