Module:EpisodeLink

-- This module was taken and adapted from the Kubera Wiki and DICE Wiki. Instructions do not apply to Viral Hit. -- -- -- -- This module needs to be updated every Monday and Tuesday when a new episode is released on Naver and LINE respectively. -- -- How webtoon numbering for Naver is calculated: -- Prologue (Episode 0): 1 -- Episodes 1 to 56: episode # + 1 -- Notice : episode # + 1 -- Episodes 57 to 90: episode # + 2 -- Alter-version : episode # + 1 -- Episodes 91 onwards: episode # + 3 -- -- -- How webtoon numbering for LINE is calculated: -- Prologue (Episode 0): 1 -- Episodes 1 onwards: episode # + 1 -- -- local p = {} function p.GetNumber( frame ) local LATEST_NAVER = 369  -- Update this on Mondays - most recent episode # local LATEST_WEBTOONS = 375 -- Update this on Wednesdays - 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 Naver link if (site == "naver") then if (anchor == "1") then if (episode <= 110) then LinkNumber = episode else LinkNumber = episode end end if (anchor == "1") or (episode <= LATEST_NAVER) then LinkTxt = "[https://comic.naver.com/webtoon/detail.nhn?titleId=293523&no=" .. LinkNumber .. " Korean Episode]" else LinkTxt = "Not yet available on NAVER" end -- Return LINE link elseif (site == "line") then if (anchor == "1") then LinkNumber = episode end if (episode <= LATEST_WEBTOONS) then LinkTxt = "[https://webtoons.com/viewer?titleNo=371&episodeNo=" .. LinkNumber .. " English Episode]" else LinkTxt = "Not yet available on LINE" end end return LinkTxt end return p --