Module:Sandbox/DannyS712/count
local p = {}
function p.count(frame)
local page = mw.title.getCurrentTitle()
local content = page:getContent()
if content == nil then
return ""
end
local replaced = ""
local number = 0;
replace, number = string.gsub( content, "#", "#")
return number;
end
function p.countAt(frame)
local target = frame.args[1]
if target == nil then
return "target was nil"
end
local title = "WikiProject Abandoned Drafts/Stale drafts/" .. target
local page = mw.title.makeTitle( 4, title )
local content = page:getContent() or 0
local replaced = ""
local number = 0;
replace, number = string.gsub( content, "#", "#")
local total = frame.args[2] or 1000
local progress = ( total - number ) / 10
local result = number .. " || " .. progress .. "%"
return result;
end
function p.countFfD(frame)
local content = mw.title.makeTitle( 4, "Files_for_discussion" ):getContent() or "Error #1"
content = mw.text.split( content, "== Old discussions ==")[2]
content = mw.text.split( content, "For older nominations")
local to_return = content[1]
return to_return
end
function p.countRM(frame)
local content = mw.title.makeTitle( 4, "Requested_moves/Current_discussions" ):getContent() or "Error #1"
content = mw.text.split( content, "===Elapsed listings===")[2]
local _, count = string.gsub( content, "|Discuss%]%]%)", "|Discuss%]%]%)")
local _, count2 = string.gsub( content, "|Di<u>scu</u>ss%]%]%)", "|Di<u>scu</u>ss%]%]%)");
local dump = require('Module:Dump')._dump
return "Elapsed listings:" .. (count + count2) .. dump( content, 'content' )
--return to_return
end
return p
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.