Module:EpisodeLink

-- This module was taken and adapted from the Boxer Wiki and the Darbi Wiki -- -- -- -- This module needs to be updated every Thursday when a new episode is released on LINE. -- -- How webtoon numbering for LINE is calculated: -- Episodes 1 onwards: episode # -- --

local p = {}

function p.GetNumber( frame ) local LATEST_WEBTOONS = 52 -- Update this on Thursdays - most recent episode # local site = frame.args[1] local anchor = frame.args[2] local episode = frame.args[3] local LinkNumber = 0 local LinkTxt = "Something went wrong."

-- Get the link number. episode = tonumber( episode )

-- Return LINE link if (site == "line") then if (anchor == "1") then LinkNumber = episode end if (episode <= LATEST_WEBTOONS) then LinkTxt = "[https://webtoons.com/viewer?titleNo=1691&episodeNo=" .. LinkNumber .. " English Episode]" else LinkTxt = "Not yet available on LINE" end end return LinkTxt end

return p --