Module:TestModule: Difference between revisions
Appearance
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
function p.externalDataTest( frame ) | function p.externalDataTest( frame ) | ||
names = {'John', 'Joe', 'Steve'} | |||
for i, name in ipairs(names) do | |||
print (name) | |||
end | |||
local data, errors = mw.ext.externaldata.getWebData { | local data, errors = mw.ext.externaldata.getWebData { | ||
url = 'https://discoursedb.org/wiki/Special:GetData/Fruits_data' | url = 'https://discoursedb.org/wiki/Special:GetData/Fruits_data' |
Revision as of 10:25, 10 June 2025
local p = {} --p stands for package
function p.hello( frame )
return "Hello, world!"
end
function p.externalDataTest( frame )
names = {'John', 'Joe', 'Steve'}
for i, name in ipairs(names) do
print (name)
end
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'
}
return data[2].shape
end
return p