Jump to content

Module:Outline of the week

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by The Transhumanist (talk | contribs) at 00:03, 3 October 2023 (encase in function). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local olotw = {}; 

-- Define a list of Wikipedia outline page names
local pages = {
    "[[Outline of physics]]",
    "[[Outline of mathematics]]",
    "[[Outline of computer science]]",
    "[[Outline of biology]]",
    "[[Outline of history]]",
    "[[Outline of literature]]",
    "[[Outline of music]]",
    "[[Outline of philosophy]]",
    "[[Outline of psychology]]",
    "[[Outline of sociology]]"
}

-- Define a function to display the selected page name
function displayPageName()
    -- Get the current week number
    local week = os.date("%U")

    -- Use the week number to select a page from the list
    local page = pages[tonumber(week) % #pages + 1]

    -- Display the selected page
    print(page)
end

return olotw