Modul:Benutzer:Gadacz/MyScript.lua
Die Dokumentation für dieses Modul kann unter Modul:Benutzer:Gadacz/MyScript.lua/Doku erstellt werden
Die Dokumentation für dieses Modul kann unter Modul:Benutzer:Gadacz/MyScript.lua/Doku erstellt werden
-- Siehe https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua
-- P1448 = official name
-- native label (P1705) Name der Entität in Amts- oder Originalsprache
-- official language (P37) landessSprache?
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 .. '! Hier bin ich!'
end
function p.accessPage(frame)
id = mw.wikibase.getEntityIdForTitle( 'Berlin' )
url = mw.wikibase.getEntityUrl(id)
return url
end
local function getIDs(o,l)
local l=l .. 'wiki'
local id = mw.wikibase.getEntityIdForTitle(o,l)
return id
end
function p.getID(frame)
local l= frame.args[2] or 'de'
l= l .. 'wiki'
id = mw.wikibase.getEntityIdForTitle(frame.args[1],l)
--id = getIDs(frame.args[1],frame.args[2])
return id
end
function p.EntityIdForTitle(frame) -- Siehe Modul:Wikibase
return mw.wikibase.getEntityIdForTitle( frame.args[1] )
end
function p.accessData(frame)
prop = -1
local arg = frame.args[1]
if not arg then
arg = 'Berlin'
end
id = mw.wikibase.getEntityIdForTitle(arg)
entity = mw.wikibase.getEntity(id)
props = entity:getProperties()
s = '<h1>' .. entity:getLabel() .. '</h1>\n' .. entity:getDescription() .. "\n\n"
for k, v in pairs(props) do
pv = entity:formatPropertyValues(v)
s = s .. pv ['label'] .. ' (' .. v .. '): ' .. pv['value'] .. "\n"
end
return "<pre>" .. s .. "</pre>"
end
function p.getFinchLabel(frame)
id = 'Q649'
finchLabel = mw.wikibase.getLabel(id)
return finchLabel
end
return p
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.