Wikipedia:Bots/Requests for approval/StradBot 2

StradBot 2
Operator:

Time filed: 03:19, Saturday, February 17, 2024 (UTC)

Function overview: Automatically populate sandboxes for modules listing disambiguation templates, set index templates or soft redirect templates; and if necessary issue edit requests to update the main modules.

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python (Pywikibot framework)

Source code available: https://github.com/mrstradivarius/dabtemplates

Links to relevant discussions (where appropriate): Template talk:Pagetype (permalink)

Edit period(s): Daily

Estimated number of pages affected: 5

Namespace(s): Module, module talk, template talk

Exclusion compliant (Yes/No): Yes

Function details: This is an expansion of Bots/Requests for approval/StradBot (task 1). Task 1 was for updating a disambiguation template list for Module:Disambiguation; this task expands this to two more use cases: updating a list of set index pages for Module:Pagetype, and updating a list of soft redirects, also for Module:Pagetype.

The bot uses the following algorithm. This has not changed since task 1.
 * 1) The bot constructs a list of disambiguation templates, set index templates or soft redirect templates. The list includes template redirects. It does this by iterating through all templates in a specific category (the   option). Non-templates are ignored, as are templates in the bot's exclusion list (the   option). It then retrieves redirects for all of these templates.
 * 2) It formats the list of templates and template redirects as a Lua table, and saves the result in a module sandbox (the   option). Saving is skipped if the module's content would not change. You can see sample output from the bot here.
 * 3) If the sandbox module was updated, and if its new content is different from that of the main module (the   option), then the bot adds an edit request to update the main module to the relevant talk page (the   option). There is a sample edit request here.

The bot will be used to update the following modules:

Discussion

 * – SD0001  (talk) 05:58, 17 February 2024 (UTC)