Module:LinkShortener

require('Module:StrManip')

local p = {}

function p.main(strArg) local str = mw.getCurrentFrame.args[1] --str = "https://bookwalker.jp/series/9555/list/ https://www.pixiv.net/en/artworks/47623820" mw.logObject(str) local table = strSplit(str," ") mw.logObject(table)

local res = "" for i,ind in ipairs(table) do   	if (ind:match("%.(.*)%.")) then siteName = ind:match("%.(.*)%.") elseif (ind:match("//(.*)%.")) then siteName = ind:match("//(.*)%.") end local siteLink = "[" .. ind .. " " .. siteName .. " ]"       if (i > 1) then res = res .. " "       end res = res .. siteLink end mw.logObject("res: "..res) return res end

return p