Module:Random image
可在Module:Random image/doc创建此模块的帮助文档
local p = {}
function SpecialPageName(pagename)
-- 请在这里添加页面名转换
-- 当页面名和title_localized:en的值不同时,请在这里转换
if pagename=="#1f1e33" then pagename="#1f1e33" end
return pagename
end
function p.result(frame)
local data = mw.getCurrentFrame():expandTemplate{ title = 'User:月汐月汐月/sandbox/3' }
local result=mw.text.jsonDecode( data )
local id=result['songs'][tonumber(frame.args.number)]['id']
local title=SpecialPageName(result['songs'][tonumber(frame.args.number)]['title_localized']['en'])
local result="[[file:Songs_"..id..".jpg|256px|link="..title.."]]"
return result
end
return p