User:ImplSearchBot/Code: Difference between revisions

m
ImplSearchBot:0
m (ImplSearchBot:0)
m (ImplSearchBot:0)
Line 81:
# We want the language name, not the fully-qualified wiki name.
$_ =~ 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";
Line 141 ⟶ 145:
&postpage("Template:$unimpltemplatename", "<includeonly>$unimplisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1);
 
# Post the template containing the listing of mittedomitted tasks.
&postpage("Template:$omittemplatename", "<includeonly>$omitlisting</includeonly>", "ImplSearchBot:Updating list body of unimplemented tasks.", 1);
 
Line 147 ⟶ 151:
# # Update the layout of the listing page, because it's changed.
# &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} );
 
}