Jump to content

Module:Wikipedia ads/data

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 04:37, 10 November 2014 (calculate the number of ads here, as the # operator won't work after we've passed the data through mw.loadData). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- This module transforms [[Module:Wikipedia ads/list]] into a format to be
-- used by mw.loadData.

local LIST_MODULE = 'Module:Wikipedia ads/list/sandbox'

local list = require(LIST_MODULE)
local ids = {}
for i, t in ipairs(list) do
	assert(t.id, string.format(
		"no 'id' field in table %d in [[%s]]",
		i, LIST_MODULE
	))
	ids[t.id] = t
end
return {list = list, ids = ids, noAds = #list}