Module:EpisodeData

local p = {}

function p.date(frame) local page_name = frame.args["page_name"] or frame.args[1] local datedata = main(page_name,"date") return datedata end

function p.mp3(frame) local page_name = frame.args["page_name"] or frame.args[1] local mp3data = main(page_name,"mp3link") return mp3data end

function p.transcript(frame) local page_name = frame.args["page_name"] or frame.args[1] local trxdata = main(page_name,"transcript") return trxdata end

function main(page_name, data_type) local title = mw.title.new(page_name) local content = title:getContent local search_string = data_type .. "%s*=%s*(.-)[|\n\r}]" local data_return = string.match(content, search_string) return data_return end

return p