Content deleted Content added
Updating published sources: TFATitleSubpageCreator: * Move to AnomieBOT II * Approved SourceUploader: * Add a new bit of metadata, with a new column in the output. All: * Add the new metadata field. |
Updating published sources: OrphanReferenceFixer: * Update tag parameter recognition. WikiProjectWorker: * Start run for WikiProject Food and drink. |
||
Line 34:
### 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:
my @iterators=(
{
generator => '
'Template:WPMIX', 'Template:Cocktails Project', 'Template:WikiProject Mixed Drinks', 'Template:Wpmix', 'Template:WP Mixed Drinks',
gpllimit => '100',▼
'Template:WPSD', 'Template:Soda', 'Template:WikiProject Soft Drinks',
'Template:WikiProject Ice Cream', 'Template:WP Ice Cream',
'Template:WikiProject Bartending', 'Template:WPBAR',
},
);
Line 54 ⟶ 59:
### page to tag (or undef to skip).
sub filter {
# $_[0]->{'title'}='Talk:'.$_[0]->{'title'} if $_[0]->{'ns'}==0;
# $_[0]->{'title'}=~s/^([^:]*):/$1 talk:/ if($_[0]->{'ns'}!=0 && ($_[0]->{'ns'}&1)==0);
return $_[0]->{'title'};
}
Line 61 ⟶ 66:
### How to copy other projects' assessments
sub copy_class {
return
#return '';
}
sub copy_importance {
return
#return '';
}
# Banner configurations.
my $main_banner='
my @preprocess_templates=('WikiProject Food and drink');
my %banner_cfgs=(
'
meta =>
},
);
my
$main_banner,
'Food and drink',
'WPFOOD',
'WPCUISINE',
'F&D',
'Wpfood',
'WikiProject Food and Drink',
'Food',
'Wikiproject Food and drink',
'WP Food',
'Wikiproject Food and Drink',
'WikiProject Food',
'WikiProject FOOD',
'Wpf',
);
sub new {
Line 112 ⟶ 119:
sub approved {
return
}
Line 215 ⟶ 222:
next;
}
}
my $need_main_banner = ($api->WPBcheck($outtxt, $main_banner) == 0);
$api->WPBcheck($outtxt, sub {
$need_main_banner=0 if(grep $name eq $_, @main_banners);
### PROCESSING ###
Line 233 ⟶ 248:
my $wikitext=shift;
$soda='soda=yes' if(grep $name eq $_, ('WPSD','Soda','WikiProject Soft Drinks'));
$mix='mix=yes' if(grep $name eq $_, ('WPMIX', 'Cocktails Project', 'WikiProject Mixed Drinks', 'Wpmix', 'WP Mixed Drinks'));
$mix='bar=yes' if(grep $name eq $_, ('WikiProject Bartending', 'WPBAR'));
$icecream='ice cream=yes' if(grep $name eq $_, ('WikiProject Ice Cream', 'WP Ice Cream'));
foreach (@$params){
$
}
push @
push @params,
return '' unless $need_main_banner;
$need_main_banner=0;
return "{{$main_banner$pp}}";
}, @preprocess_templates);
if(ref($outtxt) eq 'HASH'){
Line 251 ⟶ 279:
$merge[-1]='and '.$merge[-1] if @merge>1;
push @summary, "merging ".join((@merge>2)?', ':' ', @merge)." into $main_banner" if @merge;
# $api->warn("$title contains ".$iter->iterval.", but not in section 0\n");
}
}
Line 276 ⟶ 304:
$outtxt=$api->WPBadd($outtxt, $assess, sub {
shift; # banner
my $name=shift; # name
my $oname=shift;
my $params=shift;
Line 283 ⟶ 311:
return '' if $new;
▲ my $imp=undef;
▲ $prio=$1 if $p=~/^\s*priority\s*=\s*(\S.*?)\s*$/;
▲ }
▲ return $wikitext unless defined($prio);
▲ my @pp=();
▲ my $ct=0;
▲ my $any=0;
▲ next if $p=~/^\s*(?:priority|importance)\s*=/;
▲ push @pp, $1;
▲ $ct++;
▲ # skip
▲ } else {
▲ }
▲ }
▲ $params=\@pp;
foreach my $p (@params){
next unless $p=~/^(.+?)=(.*)$/;
Line 318 ⟶ 319:
unless(grep(/^\s*\Q$k\E\s*=\s*$re/, @$params)){
next if(grep(/^\s*\Q$k\E\s*=\s*\Q$v\E\s*$/s, @$params));
}
}
my $out="{{$oname";
$out.="|".join("|", @$params) if @$params;
$out.="}}";
return $out;
}, $main_banner, @params);
|