Content deleted Content added
Updating published sources: SourceUploader: * Sort directory pages by last modified date. * Use <nowiki><syntaxhighlight></nowiki> instead of <nowiki><source></nowiki>. d::NoWiki: * Add support for <nowiki><syntaxhighlight></nowiki>. General: * Vario |
Updating published sources: WikiProjectWorker: * Start run for WikiProject Physics, re-tagging or de-tagging redirects depending on whether the target is tagged. |
||
Line 33:
### Request link, for edit summary.
my $req="[[User:AnomieBOT/req/WikiProject
### Increment this number every time a new run is started, so we don't have to
### mess around with deleting previous runs' database entries.
my $seq=
### How to find the pages?
Line 45:
{
generator => 'embeddedin',
geititle =>
],▼
geilimit => '100',
geinamespace => 1,
},
);
Line 65 ⟶ 61:
### How to copy other projects' assessments
sub copy_class {
#return ($_[0]->WPBmax($_[2]))[0];
}
sub copy_importance {
#return ($_[0]->WPBmax($_[2]))[1];
}
# Banner configurations.
my $main_banner='WikiProject
my @preprocess_templates=(
my %banner_cfgs=(
'WikiProject
meta => 1,
},
Line 85 ⟶ 81:
my @main_banners=(
$main_banner,
);
Line 248 ⟶ 231:
return undef if(grep $name eq $_, @main_banners);
my $soda=undef;▼
my $mix=undef;▼
my $icecream=undef;▼
push @merge, $name;▼
my $pp='';▼
foreach (@$params){▼
}▼
return '' unless $need_main_banner;
$need_main_banner=0;
return "{{$main_banner
}, @preprocess_templates);
if(ref($outtxt) eq 'HASH'){
Line 284 ⟶ 249:
}
my $pg=$title;
$pg=~s/^Talk://;
Line 289 ⟶ 255:
$page=$api->query(
titles => $pg,
);
if($page->{'code'} eq 'shutoff'){▼
$api->warn("Task disabled: ".$page->{'content'}."\n");▼
if($page->{'code'} ne 'success'){
$api->warn("Could not load $pg info: ".$page->{'error'}."\n");
next unless $pg eq ($page->{'query'}{'redirects'}[0]{'from'}//'');
$page=$api->query([],titles=>'Talk:'.$page->{'query'}{'redirects'}[0]{'to'}, prop=>'templates', tllimit=>'max');
▲ $api->warn("
return 60;
}
$page=(values %{$page->{'query'}{'pages'}})[0];
$tag=grep $_->{'title'} eq "Template:$main_banner", @{$page->{'templates'}};
}
$outtxt=$api->WPBadd($outtxt, $assess, sub {
my $banner=shift; # banner
my $name=shift; # name
my $oname=shift;
Line 310 ⟶ 282:
return '' if $new;
return undef unless(grep $
push @summary, "Removing {{$main_banner}} from redirect where target is not tagged by with {{$main_banner}}";
foreach my $p (@params){
next unless $p=~/^(.+?)=(.*)$/;
my ($k,$v)=($1,$2);
#my $re=qr/\S/;
unless(grep(/^\s*\Q$k\E\s*=\s*$re\s*$/, @$params)){
next if(grep(/^\s*\Q$k\E\s*=\s*\Q$v\E\s*$/s, @$params));
unshift @$params, "$k=$v" unless(grep(s/^(\s*\Q$k\E\s*=\s*?)(?:\S.*?)?(\s*)$/$1$v$2/s, @$params) || $k eq 'importance');
}
}
Line 325 ⟶ 303:
$out.="|".join("|", @$params) if @$params;
$out.="}}";
push @summary, "Re-tagging {{$main_banner}} as class=redirect";
return $out;
}, $main_banner, @params);
|