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:DartsOrakel
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 p = {} local error_msg = '<span style=\"font-size:100%\" class=\"error\"><code style=\"color:inherit; border:inherit; padding:inherit;\">|_template=</code> missing or empty</span>'; local tcats= '' local tcatsp='' local templateArgs = {} -- contains arguments from template involking module local function getArgs(frame) local parents = mw.getCurrentFrame():getParent() for k,v in pairs(parents.args) do --check content if v and v ~= "" then templateArgs[k]=v --parents.args[k] end end for k,v in pairs(frame.args) do --check content if v and v ~= "" then templateArgs[k]=v --parents.args[k] end end -- allow empty caption to blank default if parents.args['caption'] then templateArgs['caption'] = parents.args['caption'] end end local function loadData(frame) local source = frame.args[1] -- source of rankings Players local data = require('Module:DartsOrakel/data/Players'); end local function noAc(str) local tableAccents = {} tableAccents["À"] = "A" tableAccents["Á"] = "A" tableAccents["Â"] = "A" tableAccents["Ã"] = "A" tableAccents["Ä"] = "A" tableAccents["Å"] = "A" tableAccents["Æ"] = "AE" tableAccents["Ç"] = "C" tableAccents["È"] = "E" tableAccents["É"] = "E" tableAccents["Ê"] = "E" tableAccents["Ë"] = "E" tableAccents["Ì"] = "I" tableAccents["Í"] = "I" tableAccents["Î"] = "I" tableAccents["Ï"] = "I" tableAccents["Ð"] = "D" tableAccents["Ñ"] = "N" tableAccents["Ò"] = "O" tableAccents["Ó"] = "O" tableAccents["Ô"] = "O" tableAccents["Õ"] = "O" tableAccents["Ö"] = "O" tableAccents["Ø"] = "O" tableAccents["Ù"] = "U" tableAccents["Ú"] = "U" tableAccents["Û"] = "U" tableAccents["Ü"] = "U" tableAccents["Ý"] = "Y" tableAccents["Þ"] = "P" tableAccents["ß"] = "s" tableAccents["à"] = "a" tableAccents["á"] = "a" tableAccents["â"] = "a" tableAccents["ã"] = "a" tableAccents["ä"] = "a" tableAccents["å"] = "a" tableAccents["æ"] = "ae" tableAccents["ç"] = "c" tableAccents["č"] = "c" tableAccents["ć"] = "c" tableAccents["è"] = "e" tableAccents["é"] = "e" tableAccents["ê"] = "e" tableAccents["ë"] = "e" tableAccents["ì"] = "i" tableAccents["í"] = "i" tableAccents["î"] = "i" tableAccents["ï"] = "i" tableAccents["ł"] = "l" tableAccents["ð"] = "eth" tableAccents["ñ"] = "n" tableAccents["ò"] = "o" tableAccents["ó"] = "o" tableAccents["ô"] = "o" tableAccents["õ"] = "o" tableAccents["ö"] = "o" tableAccents["ø"] = "o" tableAccents["ù"] = "u" tableAccents["ú"] = "u" tableAccents["û"] = "u" tableAccents["ü"] = "u" tableAccents["ý"] = "y" tableAccents["þ"] = "p" tableAccents["ÿ"] = "y" local normalisedString = '' local normalisedString = str: gsub("[%z\1-\127\194-\244][\128-\191]*", tableAccents) return normalisedString end local function nameEqual(str1, str2) return string.lower(noAc(str1)):gsub( "%W", "")==string.lower(noAc(str2)):gsub( "%W", "") end function p.main(frame) getArgs(frame) -- returns args table having checked for content loadData(frame) local data = require('Module:DartsOrakel/data/Players'); local outputString = "" local validCode = false local player = templateArgs[2] -- player name passed as parameter local rank, move for _,u in pairs(data.library) do -- run through the list if nameEqual(u[2], player) then -- if code = passed parameter outputString = '[https://app.dartsorakel.com/player/details/' .. u[1] .. ' ' .. u[2] .. ' player profile at Darts Orakel]' end end return outputString 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)
Templates used on this page:
Template:Tl
(
edit
)
Module:DartsOrakel/doc
(
edit
)