Module:TestModule: Difference between revisions
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
| Line 2: | Line 2: | ||
function p.hello( frame ) | function p.hello( frame ) | ||
return "Hello, world!" | |||
end | end | ||
function p.externalDataTest( frame ) | function p.externalDataTest( frame ) | ||
local data, errors = | |||
mw.ext.externaldata.getWebData | |||
{ | |||
url = 'https://discoursedb.org/wiki/Special:GetData/Fruits_data', | |||
data = {name = 'Name', color = 'Color', shape = 'Shape'}, | |||
format = 'CSV with header' | |||
} | |||
names = {'John', 'Joe', 'Steve'} | |||
for i, name in ipairs(names) do | |||
end | |||
return data[2].shape | |||
return data[2].shape | |||
end | end | ||
return p | return p | ||