Module:User scripts table
Appearance
![]() | This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
This module reads the table in WP:User scripts/Most imported scripts and produces the one in WP:User scripts/Ranking.
Usage
The module can be called either directly through {{#invoke:User scripts table|main}} or via its associated template {{User scripts table}}.
local source = mw.title.new('Wikipedia:User scripts/Most imported scripts'):getContent()
for script, total, active in mw.ustring.gmatch(source, '\n%| %[%[([^%]]+)%]%] -\n%| (%d+) -\n%| (%d+)') do
local row = mw.html.create('tr')
:tag('td'):wikitext(script)
:tag('td'):wikitext(active)
:tag('td'):wikitext(total)
end