Jump to content

Module:PopularArticles

From Iskomunidad
Revision as of 06:22, 2 October 2026 by IskoAdmin (talk | contribs)

Documentation for this module may be created at Module:PopularArticles/doc

local p = {}

function p.main(frame)

    local category = frame.args.category or "Theses"

    local data = mw.ext.analytics.getViewsData({
        page = "Category:" .. category
    })

    if not data then
        return "NO DATA RETURNED"
    end

    local output = {
        "Analytics test for Category:" .. category
    }

    for key, value in pairs(data) do
        table.insert(
            output,
            tostring(key) .. " = " .. tostring(value)
        )
    end

    return table.concat(output, "<br>")
end

return p