Module:Electowidget: Difference between revisions

Content added Content deleted
(Still futzing)
(added datapage param to p.get_data() rather than hardcoding to "2009 Burlington, Vermont Mayoral Election data")
Line 37: Line 37:
end
end


function p.get_data()
function p.get_data(datapage)
-- 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 = mw.title.new("2009 Burlington, Vermont Mayoral Election data")
local title = mw.title.new(datapage)
local s = title:getContent()
local s = title:getContent()
local i, j = s:find( "<electowidget>", 1, true )
local i, j = s:find( "<electowidget>", 1, true )