FANDOM


-- This module was taken and adapted from the Kubera Wiki & Bastard Wiki
-- 
-- 
-- 
-- This module needs to be updated every Friday when the new Naver and LINE chapters are released.
-- 
-- How webtoon numbering for Naver is calculated:
-- Chapters 1 onwards: chapter #
--
--
-- How webtoon numbering for LINE is calculated:
-- Chapters 1 to 21: chapter #
-- Chapters 22 onwards: chapter # + 1
--
--
 
local p = {}
 
function p.GetNumber( frame )
    local LATEST_NAVER = 69   -- Update this on Fridays - most recent chapter #
    local LATEST_WEBTOONS = 66 -- Update this on Fridays - 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
    		LinkNumber = chapter
    	end
    	if (chapter <= LATEST_NAVER) then
            LinkTxt = "[http://comic.naver.com/webtoon/detail.nhn?titleId=670150&no=" .. LinkNumber .. " Naver]"
        else
            LinkTxt = "Not yet available on [http://comic.naver.com/webtoon/list.nhn?titleId=670150 Naver]"
        end
    -- Return LINE link
    elseif (site == "line") then
    	if (anchor == "1") then
	    	if (chapter <= 21) then LinkNumber = chapter
    		else LinkNumber = chapter + 1
    		end
    	end
        if (chapter <= LATEST_WEBTOONS) then
            LinkTxt = "[http://webtoons.com/viewer?titleNo=700&episodeNo=" .. LinkNumber .. " LINE]"
        else
            LinkTxt = "Not yet available on [http://webtoons.com/episodeList?titleNo=700 LINE]"
        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.