FANDOM


-- This module was taken and adapted from the Unordinary Wiki
-- 
-- 
-- 
-- This module needs to be updated every Wednesday when the new Naver and LINE chapters are released.
--
-- How webtoon numbering for LINE is calculated:
--Chapters 0 onwards: chapter # + 1
--
 
local p = {}
 
function p.getLatest()
    return 6 -- Update this on Wednesday - most recent chapter #
end
 
function p.GetNumber( frame )
    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 LINE link
    if (site == "line") then
            if (anchor == "1") then
    	    LinkNumber = chapter + 1
    	end
        if (chapter <= LATEST_WEBTOONS) then
            LinkTxt = "[http://webtoons.com/viewer?titleno=1191&episodeNo=" .. LinkNumber .. " LINE]"
        else
            LinkTxt = "Not yet available on [http://webtoons.com/episodeList?titleNo=1191 LINE]"
        end
    end
    return LinkTxt
end
 
return p
--[[Category:Lua modules]]