User:SOTO/bot tricks: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(Created page with "== Adding a category to the bottom of a page == === Step 1 === <pre>python add_text.py -cat:"category" -text:"Category:New category" -pt:1 -except:"New category"</pre> ===...")
Tag: sourceedit
 
No edit summary
Tag: sourceedit
Line 4: Line 4:
=== Step 2 ===
=== Step 2 ===
<pre>python replace.py -cat:"New category" -regex "\[\[Category:(New category)\]\]\r\n([\s\S]*)\r\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" -pt:1</pre>
<pre>python replace.py -cat:"New category" -regex "\[\[Category:(New category)\]\]\r\n([\s\S]*)\r\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" -pt:1</pre>
[[Category:User SOTO]]

Revision as of 21:03, 23 October 2016

Adding a category to the bottom of a page

Step 1

python add_text.py -cat:"category" -text:"[[Category:New category]]" -pt:1 -except:"New category"

Step 2

python replace.py -cat:"New category" -regex "\[\[Category:(New category)\]\]\r\n([\s\S]*)\r\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" -pt:1