Module:VOCALOID殿堂曲/Stats
跳转到导航
跳转到搜索
此模块的文档可以在Module:VOCALOID殿堂曲/Stats/doc创建
local module = {}
local getArgs = require('Module:Arguments').getArgs
function module.count(page)
local title = mw.title.new(page)
local content = title:getContent()
if not content then
return
end
local count = 0
for i in string.gmatch(content, "t?T?emple ?_?Song") do
count = count + 1
end
return count
end
function module.main(frame)
local args = getArgs(frame)
local prefix = args['prefix']
local startYear = args['startYear']
local includeSelf = args['includeSelf']
local i = startYear
local total = 0
if includeSelf then
local count = module.count(prefix)
if count then
total = count
end
end
while true do
local count = module.count(string.format("%s/%d年投稿", prefix, i))
if not count then
break
end
total = total + count
i = i + 1
end
return tostring(total)
end
return module