Différences entre les versions de « Module:ScribuntoTest »
De Semantic MediaWiki - Sandbox
m |
|||
Ligne 13 : | Ligne 13 : | ||
myResult = "" | myResult = "" | ||
for k,v in pairs(queryResult.query.results) do | for k,v in pairs(queryResult.query.results) do | ||
− | myResult = myResult .. v.fulltext .. " " .. v.fullurl .. "|" .. v.printouts["Modification date"][0].timestamp .. " | + | myResult = myResult .. v.fulltext .. " " .. v.fullurl .. " | " .. v.printouts["Modification date"][0].timestamp .. "<br/>" |
end | end | ||
return myResult | return myResult |
Version du 12 septembre 2016 à 16:03
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
myResult = ""
for k,v in pairs(queryResult.query.results) do
myResult = myResult .. v.fulltext .. " " .. v.fullurl .. " | " .. v.printouts["Modification date"][0].timestamp .. "<br/>"
end
return myResult
end
return queryResult
end
return p