Module:AutoWikiBrowser

Cette page est semi-protégée.
Une page de Wikipédia, l'encyclopédie libre.

 Documentation[créer] [purger]
local p = {}

function p.getList( frame )
    local success, data = pcall( mw.loadJsonData, 'Wikipédia:AutoWikiBrowser/CheckPageJSON' )
    if not success then
        return 'Erreur Lua : ' .. data
    end

    -- "enabledusers" ou "enabledbots"
    local group = frame.args.group
    if not group then
        return 'Paramètre « group » non renseigné'
    end
    if not data[ group ] then
        return 'Groupe non trouvé : ' .. group
    end

    local lis = {}
    for i, item in ipairs( data[ group ] ) do
        lis[ i ] = '* ' .. frame:expandTemplate{ title = 'u', args = { item } }
    end

    return table.concat( lis, '\n' )
end

return p