« Module:ZoteroAPI » : différence entre les versions
Aller à la navigation
Aller à la recherche
Page créée avec « local p = {} function p.getItemRawJson(frame) local itemKey = frame.args[1] if not itemKey or itemKey == '' then return '❌ Aucun itemKey fourni.' end local url = 'https://api.zotero.org/groups/4893620/items/' .. itemKey .. '?include=data&format=json' local data = mw.ext.externalData.getExternalData({ url = url, format = 'json' }) if not data or next(data) == nil then return '❌ Aucune donnée reç... » |
Aucun résumé des modifications |
||
| Ligne 9 : | Ligne 9 : | ||
local url = 'https://api.zotero.org/groups/4893620/items/' .. itemKey .. '?include=data&format=json' | local url = 'https://api.zotero.org/groups/4893620/items/' .. itemKey .. '?include=data&format=json' | ||
local | local jsonString = mw.ext.externalData.getExternalData({ | ||
url = url, | url = url, | ||
format = 'json' | format = 'json' | ||
}) | }) | ||
if not | if not jsonString or jsonString == '' then | ||
return '❌ Aucune donnée reçue de Zotero.' | return '❌ Aucune donnée reçue de Zotero.' | ||
end | end | ||
return '<pre>' .. jsonString .. '</pre>' | |||
return '<pre>' .. | |||
end | end | ||
return p | return p | ||
Version du 11 juin 2025 à 15:55
La documentation pour ce module peut être créée à Module:ZoteroAPI/doc
local p = {}
function p.getItemRawJson(frame)
local itemKey = frame.args[1]
if not itemKey or itemKey == '' then
return '❌ Aucun itemKey fourni.'
end
local url = 'https://api.zotero.org/groups/4893620/items/' .. itemKey .. '?include=data&format=json'
local jsonString = mw.ext.externalData.getExternalData({
url = url,
format = 'json'
})
if not jsonString or jsonString == '' then
return '❌ Aucune donnée reçue de Zotero.'
end
return '<pre>' .. jsonString .. '</pre>'
end
return p