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/Danski454/SPI report
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!
require('strict') local yesno = require('Module:Yesno') local getArgs = require('Module:Arguments').getArgs local TableTools = require('Module:TableTools') local p = {} local newPageHeader = '<noinclude>__TOC__</noinclude>\n{{SPIarchive notice|__SUBPAGENAME__}}\n{{SPIpriorcases}}\n' function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local outText = '' local master = mw.title.getCurrentTitle().subpageText local socks = {} local ips = {} --Wikipedia:Sockpuppet investigations/SPI/Blank report template header if not mw.title.getCurrentTitle().exists then outText = string.gsub(newPageHeader, '__SUBPAGENAME__', master) end local status = '' if args.status then status = args.status elseif args.admincomment then status = 'close' elseif yesno(args.checkuser) then status = 'CUrequest' end outText = outText .. '===' .. mw.language.getContentLanguage():formatDate('d F Y') .. '===\n{{SPI case status|' .. status .. '}}\n' --SPI report outText = outText .. '====Suspected sockpuppets====\n' if args.socksraw then outText = outText .. args.socksraw .. '\n' -- Twinkle uses this to pass in reports (and loads are filed this way), -- so parse the reports for use by the tools section local socksraw = mw.ustring.gsub(args.socksraw, '<!%-%-.-%-%->', '') --rm comments local sockMatches = mw.ustring.gmatch(socksraw, '{{%s*[Cc]heckuser%s*|%s*1%s*=%s*(.-)%s*}}') local ipMatches = mw.ustring.gmatch(socksraw, '{{%s*[Cc]heckip%s*|%s*1%s*=%s*(.-)%s*}}') for i in sockMatches do socks[#socks + 1] = i end for i in ipMatches do ips[#ips + 1] = i end else -- loop over ip# and sock# args (copied from [[Module:Old XfD multi]]) for k, v in pairs(args) do if type(k) == 'string' then local prefix, num = k:match('^(.-)([1-9][0-9]*)$') if prefix and num then num = tonumber(num) if prefix == 'sock' then socks[num] = v elseif prefix == 'ip' then ips[num] = v end end end end socks = TableTools.compressSparseArray(socks) ips = TableTools.compressSparseArray(ips) for i=1,#socks do outText = outText .. '* {{checkuser|1=' .. socks[i] .. '}}\n' end for i=1,#ips do outText = outText .. '* {{checkip|1=' .. ips[i] .. '}}\n' end end outText = outText .. '<!-- You may duplicate the templates above ({{checkuser}} and {{checkIP}}) to list more accounts-->\n' --Tools outText = outText .. '*\'\'\'Tools\'\'\': <span class="plainlinks">[https://tools.wmflabs.org/sigma/editorinteract.py?users=' .. mw.uri.encode(master) for i=1,#socks do outText = outText .. '&users=' .. mw.uri.encode(socks[i]) end for i=1,#ips do outText = outText .. '&users=' .. mw.uri.encode(ips[i]) end outText = outText .. ' Editor interaction utility] β’ [https://tools.wmflabs.org/interaction-timeline?wiki=enwiki&user=' .. mw.uri.encode(master) if socks[1] then outText = outText .. '&user=' .. mw.uri.encode(socks[1]) end outText = outText .. ' Interaction Timeline] β’ [https://tools.wmflabs.org/betacommand-dev/UserCompare/' .. mw.uri.encode(master) .. '.html User compare report]</span> <small>\'\'Auto-generated every hour.\'\'</small>\n\n' --evidence if args.evidence then outText = outText .. args.evidence else outText = outText .. "''No evidence submitted''" end outText = outText .. ' ~~~~\n\n' .. '====<big>Comments by other users</big>====\n' .. '<small>\'\'Accused parties may also comment/discuss in this section below. See [[Wikipedia:Sockpuppet investigations/SPI/Guidance#Defending yourself against claims|Defending yourself against claims]].\'\'</small>' .. '\n\n====<big>Clerk, CheckUser, and/or patrolling admin comments</big>====\n' if args.admincomment then outText = outText .. args.admincomment end outText = outText .. '\n\n----<!-- All comments go ABOVE this line, please. -->' return outText 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/Danski454/SPI report/doc
(
edit
)