Jump to content

Module:CountryData/cacheI: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Add loadData-compatible modules to cache the content of the most-used country data
 
Put the redirects all on the summary cache. *** existing text overwritten ***
Line 1: Line 1:
local CountryData = require('Module:CountryData')
local CountryData = require('Module:CountryData')
local redirects = {IRL='Republic of Ireland', ITA='Italy', ISL='Iceland', IND='India', IDN='Indonesia', IRN='Iran', IRQ='Iraq', ISR='Israel', INA='Indonesia', IRI='Iran', IRE='Ireland', IVB='British Virgin Islands', ISV='U.S. Virgin Islands', ['Islamic State of Iraq and the Levant']='Islamic State in Iraq and the Levant', ['Iraqi Kurdistan']='Kurdistan Region'}
local pages = {'India', 'Idaho', 'Isle of Wight', 'Iceland', 'Indiana', 'Isle of Man', 'Ireland', 'Indonesia', 'Iraq', 'Illinois', 'Ivory Coast', 'Islamic State in Iraq and the Levant', 'Independent State of Croatia', 'Italy', 'Iowa', 'Iran', 'Israel'}
local pages = {'Independent State of Croatia', 'Iran', 'Israel', 'Iceland', 'Iraq', 'India', 'Italy', 'Ireland', 'Idaho', 'Isle of Wight', 'Indonesia', 'Indiana', 'Iowa', 'Isle of Man', 'Islamic State in Iraq and the Levant', 'Ivory Coast', 'Illinois'}
local p = {
local p = {
redirects = redirects,
data = {}
data = {}
}
}

Revision as of 20:02, 3 May 2021

local CountryData = require('Module:CountryData')
local pages = {'India', 'Idaho', 'Isle of Wight', 'Iceland', 'Indiana', 'Isle of Man', 'Ireland', 'Indonesia', 'Iraq', 'Illinois', 'Ivory Coast', 'Islamic State in Iraq and the Levant', 'Independent State of Croatia', 'Italy', 'Iowa', 'Iran', 'Israel'}
local p = {
	data = {}
}
local frame = mw.getCurrentFrame()

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

return p