Module:Utils

local p = {}

function p.getHostFromURL( frame ) s = frame.args[1] return (s.."/"):match("://(.-)[:/]") end

function p.stripAPIURL( frame ) s = frame.args[1] return s:match("https?://(.+)") end

function p.getBranchNumber( frame ) s = frame.args[1] return s:match("%.(%d+)") end

function p.getExtensionVersions( frame ) extensionName = frame.args[1] local query = { 'Has extension::Extension:'..extensionName..'', 'Has extension version::!~*MLEB*', '?Has extension version=version' }	query.limit = 5000

local result = mw.smw.ask( query ) local versions = {} if result and #result then for _, data in pairs( result ) do			versions[data.version] = data.version end end table.sort(versions) local output = '' for _, version in ipairs( versions ) do output = output .. version .. '\n' end

return output end

return p