Module:CountryData/cacheC: Difference between revisions
Appearance
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 pages = {'Community of Madrid', 'Cascadia', 'Confederate States of America', 'California', 'Calgary', 'Connecticut', 'Christmas Island', 'Croatia', 'Commonwealth of Independent States', 'Czechoslovakia', 'Chad', 'Castile and León', 'Central African Republic', 'Costa Rica', 'Chihuahua', 'Cape Verde', 'Czech Republic', 'Canada', 'Cambodia', 'Colorado', 'Cumbria', 'Cocos (Keeling) Islands', 'Chechen Republic of Ichkeria', 'Canary Islands', 'Chicago', 'Colombia', 'China', 'Chile', 'Ceylon', 'Chechnya', 'Catalonia', 'Cuba', 'Curaçao', 'Chinese Taipei', 'Cheshire', 'Cayman Islands', 'Castilla–La Mancha', 'Cantabria', 'Cornwall', 'Comoros', 'Cameroon', 'Cook Islands', 'Cyprus'} |
|||
local redirects = {CYP='Cyprus', CZE='Czech Republic', CMR='Cameroon', CAN='Canada', CPV='Cape Verde', CAF='Central African Republic', CHL='Chile', CHN='China', COL='Colombia', COM='Comoros', COD='Democratic Republic of the Congo', COK='Cook Islands', CRI='Costa Rica', CIV='Ivory Coast', CUB='Cuba', CHE='Switzerland', CRO='Croatia', CHI='Chile', CAY='Cayman Islands', CSK='Czechoslovakia', CH='Switzerland', CGO='Republic of the Congo', CHA='Chad', CRC='Costa Rica', CUR='Curaçao', CAM='Cambodia', CTA='Central African Republic', CSA='Confederate States of America', CIS='Commonwealth of Independent States', CUW='Curaçao', ['Cote d\'Ivoire']='Ivory Coast', Congo='Republic of the Congo', ['Congo DR']='Democratic Republic of the Congo', Czech='Czech Republic', ['Collectivity of Saint Martin']='Saint Martin', ['Confederate States']='Confederate States of America', ['Côte d\'Ivoire']='Ivory Coast', Crimea='Autonomous Republic of Crimea'} |
|||
local pages = {'Christmas Island', 'Connecticut', 'Community of Madrid', 'Cascadia', 'Curaçao', 'Chad', 'Chechen Republic of Ichkeria', 'Ceylon', 'Confederate States of America', 'Canada', 'Chihuahua', 'Castilla–La Mancha', 'Chechnya', 'Cumbria', 'Comoros', 'Chile', 'Colombia', 'Cape Verde', 'Catalonia', 'Czech Republic', 'California', 'Czechoslovakia', 'Cayman Islands', 'Croatia', 'Cyprus', 'Commonwealth of Independent States', 'Cuba', 'Calgary', 'Cook Islands', 'Cantabria', 'Chinese Taipei', 'Colorado', 'China', 'Cameroon', 'Cheshire', 'Castile and León', 'Cambodia', 'Cornwall', 'Cocos (Keeling) Islands', 'Costa Rica', 'Canary Islands', 'Chicago', 'Central African Republic'} |
|||
local p = { |
local p = { |
||
redirects = redirects, |
|||
data = {} |
data = {} |
||
} |
} |
Revision as of 20:01, 3 May 2021
local CountryData = require('Module:CountryData')
local pages = {'Community of Madrid', 'Cascadia', 'Confederate States of America', 'California', 'Calgary', 'Connecticut', 'Christmas Island', 'Croatia', 'Commonwealth of Independent States', 'Czechoslovakia', 'Chad', 'Castile and León', 'Central African Republic', 'Costa Rica', 'Chihuahua', 'Cape Verde', 'Czech Republic', 'Canada', 'Cambodia', 'Colorado', 'Cumbria', 'Cocos (Keeling) Islands', 'Chechen Republic of Ichkeria', 'Canary Islands', 'Chicago', 'Colombia', 'China', 'Chile', 'Ceylon', 'Chechnya', 'Catalonia', 'Cuba', 'Curaçao', 'Chinese Taipei', 'Cheshire', 'Cayman Islands', 'Castilla–La Mancha', 'Cantabria', 'Cornwall', 'Comoros', 'Cameroon', 'Cook Islands', 'Cyprus'}
local p = {
data = {}
}
local frame = mw.getCurrentFrame()
for _,v in ipairs(pages) do
p.data[v] = CountryData.gettable(frame, v, {})
end
return p