User:L10nM4st3r/sandbox

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

User:L10nM4st3r/sandbox

Noobaward.png
Nominated Noob of the Moment
This user has been nominated for Noob of the Moment — you can vote for them or nominate your favourite users at Uncyclopedia:Noob of the Moment.  

mw.config.get -> https://www.mediawiki.org/wiki/Manual:Interface/JavaScript


For when I decide to revamp the show notifications message: https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&meta=notifications&formatversion=2&notfilter=read&notsections=alert%7Cmessage


css styling id for the edit textbox -> wpTextbox1


Useful Templates[edit | edit source]

{{tlx|<template name>|<arguments>}} - used for previewing a template's link, and supports any number of arguments.


ToDo List[edit | edit source]

  1. Add list buttons (to create lists)
  2. Add common typo correction (have a buton, not an autocorrection feature)
  3. Typing {{Tl|, {{tlx|, {{ping|, {{u|, {{user|, or {{userlinks| will give auto-completions for usernames/templates (whichever fits best)


-- For the wSidebar tool:

  1. Add templating links (and speedy delete button) to sidebar
  2. Make the template remover integrate with the sidebar tool if it is present.


-- For template remover

  1. [1] Implement this and use this code instead of regular pre-pending of "subst" in templates. (Add an "oldsubst" option though, incase this script gets fucked by a particular template and I don't have the time to fix it at the time.)
  2. Make all parser functions use their raw code if the input parameters has a dynamic property or template. (PAGENAME, REVISIONUSER, SUBPAGENAME, etc Full List)
  3. Add additional steps to the template remover's automated queue, when I feel like it
    1. Deep-templating eradication 1 - Now finally, recheck all templates that STILL use this template, and check every page that is used by that template. Do this for every template. (Have a cache of pages that have already been searched and cleared. Do not check the same page twice.)
    2. Deep-templating eradication 2 - same as stage 3, but in all namespaces
    3. At this point, if the template is still in use, it is impossible to fix that page with a script


-- Create a category renamer How to check for pages inside a category Then rename this category


Changelog for those curious[edit | edit source]

Before, the template remover script was "editing" every page, even if no changes were to be made. And it would try to edit the page (including re-processing the page's text) EVERY SINGLE TIME it failed and had to retry. That's like reloading the entire page multiple times because one single part of it hasn't loaded yet.

Now the script will first grab the page's text from the server, and make changes to the local version as needed. Then, it will check if any changes were made. If no changes were made, it will purge the page (to update its "hat links here" status) and move on to the next page. If the content HAS changed (the template was found and dealt with), it will store a local version of these changes, so it does not need to try making them again. (Worst case scenario, in a very rare case, is it may possibly revert an edit in the case of an edit conflict, if the timing is JUSTT right. But if that's the case, the edit can easily be reverted, and I can fix that page again later).

So basically, instead of re-asking the server every single time I get ratelimited for the page's content, I instead ask only one time, and use that same content until it works. Also by doing this, I reduce the number of POST requests I make to the server, which decreases the number of times I get rate-limited in the first place.