Module:ChapterLinkRewind

-- This module was taken and adapted from the Kubera Wiki -- -- -- -- This module needs to be updated every Saturday when the new Lezhin chapter is released. -- -- How webtoon numbering for Lezhin is calculated: -- Chapter 1 onwards: chapter # -- -- How webtoon numbering for Mangacow is calculated: -- Chapter 1 onwards: chapter # -- -- -- local p = {} function p.GetNumber( frame ) local LATEST_LEZHIN = 272  -- Update this on Saturdays - most recent chapter # local LATEST_MANGACOW = 272 -- Update this whenever a new chapter is released local site = frame.args[1] local anchor = frame.args[2] local chapter = frame.args[3] local LinkNumber = 0 local LinkTxt = "Something went wrong." -- Get the link number. chapter = tonumber( chapter ) -- Return Lezhin link if (site == "lezhin") then if (anchor == "1") then LinkNumber = chapter end if (anchor == "1") or (chapter <= LATEST_LEZHIN) then LinkTxt = "[http://www.lezhin.com/ko/comic/dokgo/" .. LinkNumber .. " Lezhin]" else LinkTxt = "Not yet available on Lezhin" end -- Return Mangacow link elseif (site == "mangacow") then if (anchor == "1") then LinkNumber = chapter end if (chapter <= LATEST_MANGACOW) then LinkTxt = "[http://mngcow.co/Dokgo_Rewind/" .. LinkNumber .. " Mangacow]" else LinkTxt = "Not yet available on Mangacow" end end return LinkTxt end

return p --