Jump to content

Module:User:Eirikr/sandbox

From Wiktionary, the free dictionary


local export = {}

local gsub = mw.ustring.gsub
local find = mw.ustring.find
local gmatch = mw.ustring.gmatch
local match = mw.ustring.match
local sub = mw.ustring.sub
local U = mw.ustring.char



function export.talk_page_archive_links(frame)
	local archives = require "Module:array"()
	
	-- Up to current year; see http://man7.org/linux/man-pages/man3/strftime.3.html.
	for year = 2006, os.date("%Y") do
		local talk_page_title = "User talk:Eirikr/" .. year
		
		if mw.title.new(talk_page_title).exists then
			archives:insert("[[" .. talk_page_title .. "|" .. year .. "]]")
		end
	end
	
	return archives:concat(" – ")
end

function export.testing(frame)
	return "Eggplant!"
end

return export