模組:Template:Weighted page size

出自維基百科,自由嘅百科全書
模組解[]
local p = {}
function p.main( frame )
local titleText = frame.args.page
if not titleText then
return 0
end
local title = mw.title.new( titleText )
if not title then
return 0
end
local content = title:getContent()
if not content then
return 0
end
local chars = mw.ustring.len( content )
return math.floor( chars * 3.7 + 0.5 )
end
return p