Module:Sandbox/bawolff/Birthday
Appearance
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