Wikia

WoWWiki

Watchlist Recent changes

MurphBot/Category

< MurphBot

This is my Unix shell script for adding {{DEFAULTSORT:{{PAGENAME}}}} to any pages in Category:Users which do not already have it or a sort key specified for the category. Without a sort key, the default is to sort as User:..., producing a rather ugly result in the category.

Code Edit

#!/bin/sh

python replace.py -cat:Users \
	-summary:"Category sort key" \
	-excepttitle:WoWWiki- \
	-excepttext:DEFAULTSORT \
	-regex \
	'(?msi)\[\[Category:\s*Users]]' \
		'{{DEFAULTSORT:{{PAGENAME}}}}\n[[Category:Users]]'

python replace.py -cat:Users \
	-summary:"Category sort key" \
	-excepttext:DEFAULTSORT \
	-regex \
	'(?msi)\[\[Category:\s*Users]]' \
		'{{DEFAULTSORT:{{#replace:{{PAGENAME}}|WoWWiki-|}}}}\n[[Category:Users]]'

Pages on WoWWiki

95,776pages on
this wiki

Latest Photos

Add a Photo
58,077photos on this wiki
See more >

Recent Wiki Activity

See more >

Recent Questions

Around Wikia's network

Random Wiki