packaged::Trial;useutf8;usestrict;useAnomieBOT::API;usePOSIX;AnomieBOT::API::load('d::Talk');usevarsqw/@ISA/;@ISA=qw/d::Talk/;=pod=head1 NAMEd::Trial - AnomieBOT trial utility decorator=head1 SYNOPSIS use AnomieBOT::API; $api = new AnomieBOT::API('conf.ini', 1); $api->decorators(qw/d::Trial/);=head1 DESCRIPTIONC<d::Trial> contains utility functions for use by an AnomieBOT task in trial.When "d::Trial" is used as a decorator on the API object, the following methodsare available.In addition, all A<d::Talk> methods are also available, as this decorator usesthem internally.=head1 METHODS PROVIDED=over=item $api->check_trial( $until, $brfa )Checks if the current timestamp is past the C<$until> timestamp. If not,returns false; if so, whines to the bot talk page and returns a scalar ref thatshould be dereferenced and returned.=cutsubcheck_trial{my$api=shift;my$until=shift;my$brfa=shift;return0iftime<$until;my$res=$api->whine("Trial complete!","This task was in trial until ".POSIX::strftime("%F %T (UTC)",gmtime$until).", which has now passed. Please stop the task and report the completion of the trial at [[Wikipedia:Bots/Requests for approval/$brfa]]. Thanks.",Summary=>"Trial complete!");return(($res->{'code'}eq'success')?\undef:\60);}=pod=item $api->trial_complete( $brfa )Whines to the bot talk page and returns a value that should be returned.=cutsubtrial_complete{my$api=shift;my$brfa=shift;my$res=$api->whine("Trial complete!","This trial for this task is now complete. Please stop the task and report the completion of the trial at [[Wikipedia:Bots/Requests for approval/$brfa]]. Thanks.",Summary=>"Trial complete!");return(($res->{'code'}eq'success')?undef:60);}1;=pod=back=head1COPYRIGHTCopyright2008–2013AnomieThislibraryisfreesoftware;youcanredistributeitand/ormodifyitunderthesametermsasPerlitself.