User:ImplSearchBot/Code: Difference between revisions
Content added Content deleted
m (ImplSearchBot:0) |
m (ImplSearchBot:0) |
||
Line 17: | Line 17: | ||
my $cacheonly; # Don't query the wiki for data. Just pull from cache. |
my $cacheonly; # Don't query the wiki for data. Just pull from cache. |
||
my $nosvn; |
my $nosvn; |
||
my $rebuild_all; |
|||
my $opt_matrix = { |
my $opt_matrix = { |
||
Line 26: | Line 27: | ||
"cacheonly" => \$cacheonly, |
"cacheonly" => \$cacheonly, |
||
"nosvn" => \$nosvn, |
"nosvn" => \$nosvn, |
||
"cachepath=s" => \$cachepath |
"cachepath=s" => \$cachepath, |
||
"rebuildall" => \$rebuild_all }; |
|||
my $result = GetOptions( %$opt_matrix ); |
my $result = GetOptions( %$opt_matrix ); |
||
Line 52: | Line 54: | ||
$options{'cacheonly'} = $cacheonly |
$options{'cacheonly'} = $cacheonly |
||
if defined $cacheonly; |
if defined $cacheonly; |
||
$options{'rebuild_all'} = $rebuild_all |
|||
if defined $rebuild_all; |
|||
Line 111: | Line 116: | ||
# of the pages. :-/ |
# of the pages. :-/ |
||
my $task_count_change; |
my $task_count_change; |
||
unless(exists $options{'rebuild_all'}) |
|||
{ |
{ |
||
my $cacheddata = &getcacheddata('Category:Programming Tasks'); |
my $cacheddata = &getcacheddata('Category:Programming Tasks'); |
||
my ($added, $removed) = &diffcat($alltasks, $cacheddata); |
my ($added, $removed) = &diffcat($alltasks, $cacheddata); |
||
$task_count_change = scalar @$added + scalar @$removed; |
$task_count_change = scalar @$added + scalar @$removed; |
||
} |
|||
else |
|||
{ |
|||
$task_count_change = 1; # It just needs to be nonzero... |
|||
} |
} |
||