Jump to content

Module:AWBVersions: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
other outputting
Try outputting something useful
Line 3: Line 3:
function p.main( frame )
function p.main( frame )
local version = mw.title.makeTitle( 'Wikipedia', 'AutoWikiBrowser/CheckPage/VersionJSON' )
local version = mw.title.makeTitle( 'Wikipedia', 'AutoWikiBrowser/CheckPage/VersionJSON' )
return version:getContent()
--return tostring( mw.text.jsonDecode( version:getContent() ) )
local decoded = mw.text.jsonDecode( version:getContent() )
local output = "Current Version: " .. decoded.currentversion .. "\n"
output = output .. "Newest Version: " .. decoded.newestversion .. "\n"
return output
end
end



Revision as of 08:19, 1 July 2016

local p = {}

function p.main( frame )
    local version = mw.title.makeTitle( 'Wikipedia', 'AutoWikiBrowser/CheckPage/VersionJSON' )
    
    local decoded = mw.text.jsonDecode( version:getContent() )
    local output = "Current Version: " .. decoded.currentversion .. "\n"
    output = output .. "Newest Version: " .. decoded.newestversion .. "\n"
    return output
end

return p