Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Sandbox/bawolff/Birthday

From Wikipedia, the free encyclopedia
local p = {}

local birthdays = mw.ext.data.get( 'EN Wikipedia vital articles birthdays.tab' ).data

function p.getItem()

	-- This randomizes the random number generator. It also decreases cache time of pages.
	math.randomseed( tonumber( mw.getLanguage( "en" ):formatDate( "U" ) ) * 10000 + os.clock() * 10000 )

	-- item is 3 item array, containing article name, birthday, wikidata item.
	local item = birthdays[math.random(#birthdays)]
	return '[[' .. item[1] .. ']] was born on ' .. mw.getLanguage( "en" ):formatDate( "M j.", item[2] )

end

return p