Module:Bongolium500/main page modules

local smwUtil = require('Module:SMW') local textUtil = require('Module:TextUtil') local cache = require('mw.ext.LuaCache') local p = {} local h = {} local MONTHS = {"January", "Feburary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}

function p.birthdayModule(frame) local PREFIX = "MAINPAGEBIRTHDAY-" local currentDate = os.date("%F") local outputWidget = cache.get(PREFIX .. currentDate) or "" if outputWidget == "" then local year, month, day = string.match(currentDate, "(%d+)-(%d+)-(%d+)") local monthName = MONTHS[tonumber(month)] local pageName = day .. " " .. monthName .. " (people)" local outputWidget = " Today's Birthdays! \n " -- for references: \nClick to view references. \nNot all references may be for the birthdays above." .. frame:expandTemplate{title="reflist", args={2}} .. " cache.set(PREFIX .. currentDate, outputWidget) end return outputWidget end

return p