Module:Electowidget: Difference between revisions

Content added Content deleted
(Giving up for now)
(More futzing)
Line 40: Line 40:




function p.get_data(datapage)
function p.get_data(frame)
-- copied and adapted from
-- copied and adapted from
-- https://en.wikipedia.org/wiki/Module:Format_TemplateData
-- https://en.wikipedia.org/wiki/Module:Format_TemplateData
-- local title, s = mw.title.new(tostring(datapage))
-- local title, s = mw.title.new(tostring(datapage))
local title = mw.title.new("2009 Burlington, Vermont Mayoral Election data")
local title = mw.title.new(frame.args[1])
if 1 == 1 then
local s = title:getContent()
return title
if 1 == 1 then
end
-- return mw.text.jsonEncode(s)
local s = title:getContent()
-- return mw.text.jsonEncode(datapage)
return table.concat(datapage, ",")
end
local i, j = s:find( "<electowidget>", 1, true )
local i, j = s:find( "<electowidget>", 1, true )
local r
local r