Jump to content

Module:AWBVersions: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
\n
Use mw.loadJsonData()
 
Line 2: Line 2:


function p.main( frame )
function p.main( frame )
local version = mw.title.makeTitle( 'Wikipedia', 'AutoWikiBrowser/CheckPage/VersionJSON' )
local decoded = mw.loadJsonData( 'Wikipedia:AutoWikiBrowser/CheckPage/VersionJSON' )
local decoded = mw.text.jsonDecode( version:getContent() )
local output = ''
local output = ''
for i, v in ipairs(decoded.enabledversions) do
for i, v in ipairs(decoded.enabledversions) do

Latest revision as of 05:04, 24 October 2022

local p = {}

function p.main( frame )
    local decoded = mw.loadJsonData( 'Wikipedia:AutoWikiBrowser/CheckPage/VersionJSON' )
    local output = ''
    for i, v in ipairs(decoded.enabledversions) do
    	output = output .. '* ' .. v.version
    	if v.dev then
    		output = output .. ' (svn)'
    	end
    	output = output .. '\n'
    end
    
    return output
end

return p