local getArgs = require('Module:Arguments').getArgslocal p =
function p.GetURL(frame) local args = getArgs(frame) return p._GetURL(args)end function p._GetURL(args) local ticker = args[1]
-- Get corrected ticker ticker = p.FormatTickerURL(ticker) -- NYSE official URL url = 'https://www.nyse.com/quote/XXXX:' .. ticker return urlend function p.FormatTickerURL(ticker) -- Convert to upper case ticker = string.upper(ticker) -- NYSE.com formats for preferred shares / when issued -- Example: Input: PRE.PRD, Output: PREpD ticker = string.gsub(ticker, "%.PR", "p") ticker = string.gsub(ticker, "%.WI", "w") return tickerend
return p