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.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a23018cc8e68dfff

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