User:FZ - Bot/DoubleRedirects

Setup
SearchAndReplace.setSearchString(".*\\(edit\\) →‎ "); SearchAndReplace.setReplaceString(""); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(false); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet); SearchAndReplace.replaceAll(view);
 * In jEdit. Utilities --> Buffer Options --> Character encoding. Change it to something else that can support that "→" symbol. At random, I chose UTF-32LE and it worked. Click OK.
 * On a new document, copy/paste:

SearchAndReplace.setSearchString("\\n"); SearchAndReplace.setReplaceString("]]\n           \n            \n            false\n            false\n            1\n            None\n            None\n          \n          \n            true</enabled_>\n            <Name>DblRedrct</Name>\n            <ruletype_>OnWholePage</ruletype_>\n            <replace_>[["); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(false); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet); SearchAndReplace.replaceAll(view);

SearchAndReplace.setSearchString(" →‎ "); SearchAndReplace.setReplaceString("]]</replace_>\n [["); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(false); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet); SearchAndReplace.replaceAll(view);
 * Save it in the Macros folder with a .bsh extension.

Version 1

 * The above stuff is once off, once you have the Macro saved, you don't need to do it again. From here on is the stuff you need to do each time you Fix Double Redirects. The process shouldn't take more than a minute once you get the hang of it.

PHSW-JP038 (edit) →‎ Baby Tragon →‎ Baby Tiragon 12533811 (edit) →‎ Baby Tragon →‎ Baby Tiragon DT13-JP048 (edit) →‎ Magic Stone Fusion →‎ Tablet Fusion Takeda Tetsuo (edit) →‎ Tetsuo Takeda →‎ Bronk Stone
 * Copy the list at Special:DoubleRedirects. For example, you will end up with:

Baby Tragon]]</replace_> Baby Tiragon</with_> <ifContains_ /> <ifNotContains_ /> false</regex_> false</ifIsRegex_> 1</numoftimes_> None</ifRegexOptions_> None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Baby Tragon</replace_> Baby Tiragon</with_> <ifContains_ /> <ifNotContains_ /> false</regex_> false</ifIsRegex_> 1</numoftimes_> None</ifRegexOptions_> None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Magic Stone Fusion</replace_> Tablet Fusion</with_> <ifContains_ /> <ifNotContains_ /> false</regex_> false</ifIsRegex_> <numoftimes_>1</numoftimes_> <ifRegexOptions_>None</ifRegexOptions_> <regexOptions_>None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Tetsuo Takeda</replace_> <with_>[[Bronk Stone
 * Paste the list on a new jEdit page. Run the above macro. You will end up with this:


 * In AutoWikiBrowser, use the default settings (empty, nothing changed), click on Advanced Settings, then New Rule and New Subrule, Close. Save As the settings somewhere that is easily accessible.

<Name>Rule</Name> <Name>Rule</Name> <ruletype_>OnWholePage</ruletype_> <replace_>.........	.........................			...</with_> <ifContains_ /> <ifNotContains_ />
 * Go to the XML settings file, open it with notepad and look for the Subrule place:

<Name>Rule</Name> <Name>Rule</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Baby Tragon</replace_> <with_>Baby Tiragon</with_> <ifContains_ /> <ifNotContains_ /> <regex_>false</regex_> <ifIsRegex_>false</ifIsRegex_> <numoftimes_>1</numoftimes_> <ifRegexOptions_>None</ifRegexOptions_> <regexOptions_>None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Baby Tragon</replace_> <with_>Baby Tiragon</with_> <ifContains_ /> <ifNotContains_ /> <regex_>false</regex_> <ifIsRegex_>false</ifIsRegex_> <numoftimes_>1</numoftimes_> <ifRegexOptions_>None</ifRegexOptions_> <regexOptions_>None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Magic Stone Fusion</replace_> <with_>Tablet Fusion</with_> <ifContains_ /> <ifNotContains_ /> <regex_>false</regex_> <ifIsRegex_>false</ifIsRegex_> <numoftimes_>1</numoftimes_> <ifRegexOptions_>None</ifRegexOptions_> <regexOptions_>None</regexOptions_> </IRule> <IRule xsi:type="Rule"> <enabled_>true</enabled_> <Name>DblRedrct</Name> <ruletype_>OnWholePage</ruletype_> <replace_>Tetsuo Takeda</replace_> <with_>Bronk Stone</with_> <ifContains_ /> <ifNotContains_ />
 * In the place where I've indicated with the dots, paste the jEdit Macroed stuff there and end up with:


 * Save it.


 * In AutoWikiBrowser, load the new XML settings, untick "Follow redirects" under "Options", make the list of pages and Bot away.