Created
December 8, 2013 19:44
-
-
Save legoktm/7862907 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pywikibot | |
import sys | |
template = """{{catmore|Wikipedia:Authority control}} | |
{{Wikipedia category}} | |
""" | |
main_cat = """[[Category:Pages with authority control information|{0}]]""" | |
hidden = """{{catmore|Wikipedia:Authority control}} | |
{{Wikipedia category|hidden=yes}}""" | |
rest = """[[Category:Pages with {0} identifiers]] | |
[[Category:{1} with authority control information|{0}]] | |
""" | |
site = pywikibot.Site('en', 'wikipedia', 'Legoktm') | |
name = sys.argv[1] | |
#create main | |
text = template + main_cat.format(name) | |
pg = pywikibot.Page(site, 'Category:Pages with {0} identifiers'.format(name)) | |
pg.put(text, 'creating category') | |
for thingy in ['Miscellaneous pages', 'User pages', 'Wikipedia articles']: | |
text = hidden + rest.format(name, thingy) | |
pg = pywikibot.Page(site, 'Category:{0} with {1} identifiers'.format(thingy, name)) | |
pg.put(text, 'creating category') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment