Content deleted Content added
Updating published sources: General: * New function to load a task (once). * Update the various scripts to use that function. * Update metadata for all tasks. SourceUploader: * Generate a new file, User:AnomieBOT/TaskList, since I keep forgetting |
Updating published sources: General: * BREAKING CHANGE: And it's a big one: ** Data store changed from (binary) Storable to (readable) JSON. update-db.pl will change an existing database. This may affect the exact values storable in the permanent sto |
||
Line 131:
my ($self, $api)=@_;
$api->task('WatchlistUpdater', 0, 10, qw(d::Util));
my $endtime=time()+300;
Line 153 ⟶ 151:
);
if($res->{'code'} ne 'success'){
$
return 60;
}
$res=[values(%{$res->{'query'}{'pages'}})];
if(exists($res->[0]{'revisions'}[0]{'timestamp'})){
$data->{'lastrun'}=$
} else {
$data->{'lastrun'}=0;
Line 170 ⟶ 168:
my $tok=$api->edittoken($page);
if($tok->{'code'} eq 'shutoff'){
$
return 300;
}
if($tok->{'code'} ne 'success'){
$
return 60;
}
if(exists($tok->{'missing'})){
$
$data->{'lastrun'}=time();
next;
Line 191 ⟶ 189:
my $res=$api->query([$data->{'gcontinue'}], %{$data->{'query'}}, %cont);
if($res->{'code'} ne 'success'){
$
return 60;
}
Line 207 ⟶ 205:
@r=values %$res;
} else {
$
return 60;
}
Line 238 ⟶ 236:
}
if($begin<0 || $end<0){
$
} else {
substr($outtxt,$begin,$end-$begin)=$table;
if($intxt eq $outtxt){
$
} else {
my $res=$api->edit($tok, $outtxt, $data->{'summary'}, 0, $data->{'botflag'});
if($res->{'code'} ne 'success'){
$
next;
}
$
}
}
|