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 18:26, 9 November 2014 (create module for transforming data fetched from Module:Wikipedia ads/list). 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)
-- 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] = {
		image = t.image,
		link = t.link,
		author = t.author
	}
end
return {list = list, ids = ids}