You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Module:Archive-timeline: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Krinkle
No edit summary
imported>Krinkle
No edit summary
Line 2: Line 2:
--
--
local timeline = {
local timeline = {
-- https://en.wikipedia.org/w/index.php?title=1950&oldid=908302504#Events
-- https://en.wikipedia.org/w/index.php?title=1950&oldid=908302504
["1950"] = "United States President Harry S. Truman orders the development of the hydrogen bomb",
["1950"] = "United States President Harry S. Truman orders the development of the hydrogen bomb",


-- https://en.wikipedia.org/w/index.php?title=2004&oldid=907904157#Events
-- https://en.wikipedia.org/w/index.php?title=2004&oldid=907904157
["2004"] = "Mark Zuckerberg creates Facebook",
["2004"] = "Mark Zuckerberg creates Facebook",


-- https://en.wikipedia.org/w/index.php?title=2005&oldid=908345713#Events
-- https://en.wikipedia.org/w/index.php?title=2005&oldid=908345713
["2005"] = "The first YouTube video is uploaded",
["2005"] = "The first YouTube video is uploaded",


-- https://en.wikipedia.org/w/index.php?title=2006&oldid=907909573#Events
-- https://en.wikipedia.org/w/index.php?title=2006&oldid=907909573
["2006"] = "The IAU demotes Pluto from planet to the dwarf planet",
["2006"] = "The IAU demotes Pluto from planet to the dwarf planet",


-- https://en.wikipedia.org/w/index.php?title=2007&oldid=906058026#Events
-- https://en.wikipedia.org/w/index.php?title=2007&oldid=906058026
["2007"] = "Steve Jobs introduces the original Apple iPhone",
["2007"] = "Steve Jobs introduces the original Apple iPhone",


-- https://en.wikipedia.org/w/index.php?title=2008&oldid=908430892#Events
-- https://en.wikipedia.org/w/index.php?title=2008&oldid=908430892
["2008"] = "The Spotify music streaming service is launched in Sweden",
["2008"] = "The Spotify music streaming service is launched in Sweden",


-- https://en.wikipedia.org/w/index.php?title=2009&oldid=908645735#Events
-- https://en.wikipedia.org/w/index.php?title=2009&oldid=908645735
["2009"] = "The first block of the Bitcoin blockchain is established",
["2009"] = "The first block of the Bitcoin blockchain is established",


-- https://en.wikipedia.org/w/index.php?title=2010&oldid=908693123#Events
-- https://en.wikipedia.org/w/index.php?title=2010&oldid=908693123
["2010"] = "The Winter Olympics are held in Vancouver, Canada",
["2010"] = "The Winter Olympics are held in Vancouver, Canada",


-- https://en.wikipedia.org/w/index.php?title=2011&oldid=908660745#Events
-- https://en.wikipedia.org/w/index.php?title=2011&oldid=908660745
["2011"] = "An estimated two billion people watch the wedding of Prince William and Kate Middleton",
["2011"] = "An estimated two billion people watch the wedding of Prince William and Kate Middleton",


-- https://en.wikipedia.org/w/index.php?title=2012&oldid=907887565#Events
-- https://en.wikipedia.org/w/index.php?title=2012&oldid=907887565
["2012"] = "Vladimir Putin is elected President of Russia",
["2012"] = "Vladimir Putin is elected President of Russia (again)",
 
-- https://en.wikipedia.org/w/index.php?title=2013&oldid=988063849
["2013"] = "Edward Snowden discloses a mass surveillance program and flees the country",
 
-- https://en.wikipedia.org/w/index.php?title=2014&oldid=988064178
["2014"] = "Scotland votes, barely, against independence from the United Kingdom",
-- 2014: The WHO reports a major Ebola outbreak outside West Africa. The worldwide epidemic lasts until mid-2016.
-- 2014: Malaysia Airlines Flight 370 disappears over the Gulf of Thailand with 239 people on board
 
-- https://en.wikipedia.org/w/index.php?title=2015&oldid=988072159
["2015"] = "Volkswagen is alleged to have rigged diesel emissions tests worldwide",
        -- 2015: SpaceX lands its reusable Falcon 9 rocket for the first time after a successfully return from orbital space
}
}


Line 38: Line 50:
function p.get_line( frame )
function p.get_line( frame )
local year = string.sub( frame.args[1], 0, 4 )
local year = string.sub( frame.args[1], 0, 4 )
local text = timeline[ year ] and ("
 
Historic event in " .. year .. ": 
" .. timeline[ year ] .. ".") or ""
local text = timeline[ year ] and ("
 
Also in " .. year .. ": 
" .. timeline[ year ] .. ".") or ""
return text
return text
end
end
return p
return p

Revision as of 03:46, 11 November 2020

Documentation for this module may be created at Module:Archive-timeline/doc (Test casesTest results)

-- Short anecdotes by year for use in [[Template:Archive]]
--
local timeline = {
	-- https://en.wikipedia.org/w/index.php?title=1950&oldid=908302504
	["1950"] = "United States President Harry S. Truman orders the development of the hydrogen bomb",

	-- https://en.wikipedia.org/w/index.php?title=2004&oldid=907904157
	["2004"] = "Mark Zuckerberg creates Facebook",

	-- https://en.wikipedia.org/w/index.php?title=2005&oldid=908345713
	["2005"] = "The first YouTube video is uploaded",

	-- https://en.wikipedia.org/w/index.php?title=2006&oldid=907909573
	["2006"] = "The IAU demotes Pluto from planet to the dwarf planet",

	-- https://en.wikipedia.org/w/index.php?title=2007&oldid=906058026
	["2007"] = "Steve Jobs introduces the original Apple iPhone",

	-- https://en.wikipedia.org/w/index.php?title=2008&oldid=908430892
	["2008"] = "The Spotify music streaming service is launched in Sweden",

	-- https://en.wikipedia.org/w/index.php?title=2009&oldid=908645735
	["2009"] = "The first block of the Bitcoin blockchain is established",

	-- https://en.wikipedia.org/w/index.php?title=2010&oldid=908693123
	["2010"] = "The Winter Olympics are held in Vancouver, Canada",

	-- https://en.wikipedia.org/w/index.php?title=2011&oldid=908660745
	["2011"] = "An estimated two billion people watch the wedding of Prince William and Kate Middleton",

	-- https://en.wikipedia.org/w/index.php?title=2012&oldid=907887565
	["2012"] = "Vladimir Putin is elected President of Russia (again)",

	-- https://en.wikipedia.org/w/index.php?title=2013&oldid=988063849
	["2013"] = "Edward Snowden discloses a mass surveillance program and flees the country",

	-- https://en.wikipedia.org/w/index.php?title=2014&oldid=988064178
	["2014"] = "Scotland votes, barely, against independence from the United Kingdom",
	-- 2014: The WHO reports a major Ebola outbreak outside West Africa. The worldwide epidemic lasts until mid-2016. 
	-- 2014: Malaysia Airlines Flight 370 disappears over the Gulf of Thailand with 239 people on board

	-- https://en.wikipedia.org/w/index.php?title=2015&oldid=988072159
	["2015"] = "Volkswagen is alleged to have rigged diesel emissions tests worldwide",
        -- 2015: SpaceX lands its reusable Falcon 9 rocket for the first time after a successfully return from orbital space
}

-- Exported lua module

local p = {}
function p.get_line( frame )
	local year = string.sub( frame.args[1], 0, 4 )
	local text = timeline[ year ] and ("
 
Also in " .. year .. ": 
" .. timeline[ year ] .. ".") or ""
	return text
end
return p