White Epic Wikia
Advertisement

Documentation for this module may be created at Module:ChapterLink/doc

-- 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 = 54   -- Update this on Saturdays - most recent chapter #
    local LATEST_MANGACOW = 54 -- 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/white_epic/" .. LinkNumber .. " Lezhin]"
        else
            LinkTxt = "Not yet available on [http://www.lezhin.com/ko/comic/white_epic 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/white-epic/" .. LinkNumber .. " Mangacow]"
        else
            LinkTxt = "Not yet available on [http://mngcow.co/white-epic/ Mangacow]"
        end
    end
    return LinkTxt
end

return p
--[[Category:Lua modules]]
Advertisement