User:ImplSearchBot/Code: Difference between revisions
Content added Content deleted
m (ImplSearchBot:0) |
m (ImplSearchBot:0) |
||
Line 81: | Line 81: | ||
# We want the language name, not the fully-qualified wiki name. |
# We want the language name, not the fully-qualified wiki name. |
||
$_ =~ s/^Category:// foreach (@alllanguages); |
$_ =~ s/^Category:// foreach (@alllanguages); |
||
# Get a list of the languages for which we've already provided bodies for the related omit categories. |
|||
# Store it as a hash, so the lookup will be faster. |
|||
my %createdomitcategories = map {$_, 1} $editor->get_pages_in_category('Category:Maintenance/OmitCategoriesCreated'); |
|||
print "Identifying implemented and omitted languages\n"; |
print "Identifying implemented and omitted languages\n"; |
||
Line 141: | Line 145: | ||
&postpage("Template:$unimpltemplatename", "<includeonly>$unimplisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1); |
&postpage("Template:$unimpltemplatename", "<includeonly>$unimplisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1); |
||
# Post the template containing the listing of |
# Post the template containing the listing of omitted tasks. |
||
&postpage("Template:$omittemplatename", "<includeonly>$omitlisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1); |
&postpage("Template:$omittemplatename", "<includeonly>$omitlisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1); |
||
Line 147: | Line 151: | ||
# # Update the layout of the listing page, because it's changed. |
# # Update the layout of the listing page, because it's changed. |
||
# &postpage($pagename, $pagedata, "ImplSearchBot:Updating layout of listing page.",1); |
# &postpage($pagename, $pagedata, "ImplSearchBot:Updating layout of listing page.",1); |
||
# In the future, this should check against a category to see if we've already created this page, |
|||
my $omitcategoryname = "Category:$language/Omit"; |
|||
my $omitcatpagedata = "{{omitcat_head|$language}}"; |
|||
&postpage($omitcategoryname, $omitcatpagedata, "ImplSearchBot:Updating Omit category body") |
|||
unless ( exists $createdomitcategories{$omitcategoryname} ); |
|||
} |
} |