FANDOM


-- This module was taken and adapted from the Kubera Wiki
-- 
-- 
-- 
-- This module needs to be updated every Saturday when the new Naver chapter is released and every Wednesday when the new LINE chapter is released.
-- 
-- How webtoon numbering for Naver is calculated:
-- Prologue (Chapter 0): 1
-- Chapters 1 to 31: chapter # + 1
-- Bonus Chapter 1 to 2: chapter # + 1
-- Chapters 32 to 53: chapter # + 3
-- Chapters 54 to 100: chapter # + 5
-- Bonus Chapter 3: chapter # + 5
-- Chapters 101 to 120: chapter # + 6
-- Bonus Chapter 4: chapter # + 6
-- Chapters 121 onwards: chapter # + 7
-- Chapters 180 onwards: chapter # + 8
--
--
-- How webtoon numbering for LINE is calculated:
-- Prologue (Chapter 0): 1
-- Chapters 1 onwards: chapter # + 1
--
--
 
local p = {}
 
function p.GetNumber( frame )
    local LATEST_NAVER = 201   -- Update this on Saturdays - most recent chapter #
    local LATEST_WEBTOONS = 164 -- Update this on Wednesdays - most recent chapter #
    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 Naver link
    if (site == "naver") then
        if (anchor == "1") then
	    	if (chapter <= 31) then LinkNumber = chapter + 1
		    elseif (chapter <= 53) then LinkNumber = chapter + 3
    		elseif (chapter <= 100) then LinkNumber = chapter + 5
    		elseif (chapter <= 120) then LinkNumber = chapter + 6
    		elseif (chapter <= 179) then LinkNumber = chapter + 7
    		else LinkNumber = chapter + 8
    		end
    	end
    	if (anchor == "1") or (chapter <= LATEST_NAVER) then
            LinkTxt = "[http://comic.naver.com/webtoon/detail.nhn?titleId=557676&no=" .. LinkNumber .. " Naver] (Korean)"
        else
            LinkTxt = "Not yet available on [http://comic.naver.com/webtoon/list.nhn?titleId=557676 Naver] (Korean)"
        end
    -- Return LINE link
    elseif (site == "line") then
    	if (anchor == "1") then
	    	LinkNumber = chapter + 1
    	end
        if (chapter <= LATEST_WEBTOONS) then
            LinkTxt = "[http://webtoons.com/viewer?titleNo=64&episodeNo=" .. LinkNumber .. " LINE] (English)"
        else
            LinkTxt = "Not yet available on [http://webtoons.com/episodeList?titleNo=64 LINE] (English)"
        end
    end
    return LinkTxt
end
 
return p
--[[Category:Lua modules]]

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.