Page MenuHomePhabricator

Expose cached query page outputs to lua
Open, Needs TriagePublicFeature

Description

The cached output of the various MediaWiki query pages like Special:UnusedTemplates, Special:GadgetUsage, etc should be exposed to lua. The Action API already exposes these through action=query&list=querypage so the data is already available in a machine-readable format.

Quoting from https://blog.bawolff.net/2024/01/imagining-future-mediawiki.html:

Results [of querying] should be usable for futher processing
e.g. You should be able to use the result inside a lua module and format it in arbitrary ways

Use case(s)

  • Combined with the editnotice or PageNotice systems, this could be used on JS/CSS pages to notify viewers/editors of the number of users loading the page (via data from GadgetUsage).
  • ...

Event Timeline

Oh, and we already have https://meta.wikimedia.org/wiki/Meta:GUS2Wiki/Script whose output could be parsed by a Lua module to implement the specific feature you provided.

Apart from query pages, this would be as beneficial for special pages like ListUsers (which is (somewhat) T85419: User groups should be exposed to Scribunto) and other pages that are includable – just their output not accessible. Instead of manually updating all relevant Project namespace pages or templates each time a flag is granted or revoked, these pages should be updated automatically from a single source of truth.