Module:Sandbox/Nardog/12s

local p = {}

function p.main(frame) if not frame.args[1] then return nil end local lang = mw.getContentLanguage -- local t = { '{|class="wikitable sortable"\n!User!!Last!!First!!Blocked!!Admin!!Reason\n' } local t = { '{|class="wikitable sortable"\n!User!!Last!!First\n' } for v in mw.text.gsplit(frame.args[1], '%s*\n%s*') do		if v ~= '' then -- local blocked = mw.ustring.match(v, '%d%d:%d%d,%s%d%d?%s%u%l+%s%d%d%d%d') -- local admin = mw.ustring.match(v, '%d%d%d%d%s(.-)%stalk%scontribs%s') local user = mw.ustring.match(v, 'talk%scontribs%sblocked%s(.-)%stalk') or mw.ustring.match(v, '"User:(.-)@global"') or mw.ustring.match(v, '/wiki/Special:[^/]-/(.*)') or mw.ustring.match(v, '&user=([^&#]+)') or mw.ustring.match(v, '%x+:%x-:[%x:]*/?%d*') or mw.ustring.match(v, '%d+%.%d+%.%d+%.%d+/?%d*') or mw.ustring.match(v, '^[^#<>%[%]|{}/@:]+$') -- local reason = mw.ustring.match(v, 'account creation blocked%)%s%((.+)%)')			if user then				local template = 'checkuser'				if user:find('^%x+:%x-:[%x:]*/?%d*$') or user:find('^%d+%.%d+%.%d+%.%d+/?%d*$') then					template = 'checkip'				else					user = mw.uri.decode(user, 'WIKI')				end				local last = frame:preprocess()				local first = frame:preprocess()				user = frame:expandTemplate{ title = template, args = { user } }				-- blocked = blocked and 'data-sort-type=' .. lang:formatDate('U', blocked) .. '|' .. blocked or 				-- admin = admin or 				-- reason = reason or ''				-- table.insert(t, string.format('|-\n|%s||%s||%s||%s||%s||%s\n', user, last, first, blocked, admin, reason))				table.insert(t, string.format('|-\n|%s||%s||%s\n', user, last, first))			end		end	end	table.insert(t, '|}')	return table.concat(t) end

return p