Jump to content

Module:CountryData/cacheT

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GKFX (talk | contribs) at 19:25, 3 May 2021 (Add loadData-compatible modules to cache the content of the most-used country data). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local CountryData = require('Module:CountryData')
local redirects = {TUR='Turkey', TWN='Taiwan', THA='Thailand', TUN='Tunisia', TJK='Tajikistan', TLS='East Timor', TON='Tonga', TTO='Trinidad and Tobago', TKM='Turkmenistan', TCA='Turks and Caicos Islands', TPE='Chinese Taipei', ['The Bahamas']='Bahamas', ['The Gambia']='Gambia', TCH='Czechoslovakia', Tahiti='French Polynesia', TAN='Tanzania', TRI='Trinidad and Tobago', TOG='Togo', TAH='French Polynesia', TGA='Tonga', ['The Netherlands']='Netherlands', ['Turkish Republic of Northern Cyprus']='Northern Cyprus', ['Trinidad & Tobago']='Trinidad and Tobago', ['Timor-Leste']='East Timor'}
local pages = {'Turkmenistan', 'Tennessee', 'Tristan da Cunha', 'Toronto', 'Texas', 'Tuscany', 'Tuvalu', 'Tokelau', 'Terengganu', 'Tanzania', 'Togo', 'Tibet', 'Transnistria', 'Tunisia', 'Taiwan', 'Turks and Caicos Islands', 'Turkey', 'Trinidad and Tobago', 'Thailand', 'Tajikistan', 'Tonga', 'Tasmania'}
local p = {
	redirects = redirects,
	data = {}
}
local frame = mw.getCurrentFrame()

for _,v in ipairs(pages) do
	p.data[v] = CountryData.gettable(frame, v, {})
end

return p