Module:Episodes

local p = {}

function p.peanuts(frame) local tArgs = frame:getParent if not(tArgs.args[1]) then tArgs = frame end local result result = '' title = frame:getTitle user = '' for key, value in pairs(tArgs.args) do       if (tonumber(key) ~= nil) then if (key % 3 == 1) then result = result .. '|-\n!' .. value .. '\n' elseif (key % 3 == 2) then result = result .. '|[https://www.youtube.com/watch?v=' .. value .. ' Watch]\n' else result = result .. '|[https://www.yogscast.com/video/' .. string.gsub(value, "\n", "") .. ' Watch]\n' end elseif (key == 'user') then user = key elseif (key == 'title') then title = key end end return '{| class="wikitable mw-collapsible episodeguide" style="width:100%;clear:both;text-align:center"' .. '\n' .. '!style="padding:10px" colspan="4"|' .. user .. ' - ' .. title .. '\n' .. '|-\n' .. result .. '|}' end

return p