Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/DannyS712/count
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
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
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/DannyS712/count/doc
(
edit
)