Modul:Benutzer:Reinhard Kraasch/MyScript.lua
Erscheinungsbild
Die Dokumentation für dieses Modul kann unter Modul:Benutzer:Reinhard Kraasch/MyScript.lua/Doku erstellt werden
local p = {}
--local wd = require('Module:Wikidata')
function p.hello(frame)
local name = frame.args[1]
if not name then
name = 'Welt'
end
return 'Hallo, ' .. name .. '! Dies ist Lua!'
end
function p.accessPage(frame)
id = mw.wikibase.getEntityIdForTitle( 'Berlin' )
url = mw.wikibase.getEntityUrl(id)
return url
end
function p.accessData(frame)
prop = -1
local arg = frame.args[1]
if not arg then
arg = 'Berlin'
end
s = ""
id = mw.wikibase.getEntityIdForTitle( arg )
entity = mw.wikibase.getEntity( id )
props = entity:getProperties()
for k, v in pairs(props) do
s = s .. k .. ": " .. v .. "\n"
end
return "<pre>" .. s .. "</pre>"
end
function p.getFinchLabel(frame)
id = 'Q167'
entity = mw.wikibase.getEntity( id )
finchLabel = mw.wikibase.getLabel(entity)
return finchLabel
end
return p