Différences entre les versions de « Module:ScribuntoTest »
De Semantic MediaWiki - Sandbox
Ligne 11 : | Ligne 11 : | ||
end | end | ||
if type(queryResult) == "table" then | if type(queryResult) == "table" then | ||
+ | |||
for k,v in pairs(queryResult.query.results) do | for k,v in pairs(queryResult.query.results) do | ||
− | return v.fulltext .. " " .. v.fullurl | + | return v.fulltext .. " " .. v.fullurl .. " " .. v.printouts["Modification date"][0].timestamp |
end | end | ||
end | end |
Version du 12 septembre 2016 à 15:58
La documentation pour ce module peut être créée à Module:ScribuntoTest/doc
-- Module:ScribuntoTest
local p = {}
function p.asktype()
if not mw.ext.smw then
return "mw.ext.smw module not found"
end
queryResult = mw.ext.smw.getQueryResult('[[Modification date::+]]|?Modification date|sort=Modification date|order=desc')
if queryResult == nil then
return "(no values)"
end
if type(queryResult) == "table" then
for k,v in pairs(queryResult.query.results) do
return v.fulltext .. " " .. v.fullurl .. " " .. v.printouts["Modification date"][0].timestamp
end
end
return queryResult
end
return p