|
|
| Line 10: |
Line 10: |
| local dates = {} | | local dates = {} |
| | | |
| for _, id in ipairs(ids) do | | |
| -- Konstruieren des Seitentitels anhand der Page-ID
| |
| local titleobject = mw.title.new( tonumber(id) )
| |
| --Doesn't use a colon
| |
| local existspage = titleobject.exists
| |
| local pagecontent
| |
|
| |
| if existspage then
| |
| -- Method uses a colon
| |
| pagecontent = titleobject:getContent()
| |
| | |
|
| |
| if jsonData and jsonData.Dataset.date then
| |
| table.insert(dates, jsonData.Dataset.date)
| |
| else
| |
| table.insert(dates, "Error: Datum nicht gefunden für ID " .. id)
| |
| end
| |
| else
| |
| table.insert(dates, "Error: Seite nicht gefunden für ID " .. id)
| |
| end
| |
| end
| |
|
| |
|
| | | |
| return table.concat(dates, ", ") | | return table.concat(ids, ", ") |
| end | | end |
|
| |
|
| return p | | return p |
Revision as of 13:51, 2 May 2024
Documentation for this module may be created at Module:Indicator datasets table/doc
local p = {}
function p.getDatasets(frame)
local articleids = frame.args.articleids
if not articleids then
return "Error: articleids not provided"
end
local ids = mw.text.split(articleids, ",")
local dates = {}
return table.concat(ids, ", ")
end
return p