Modulo:Webarchive/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
scorporato in pagina di configurazione |
entry point per chiamata da modulo |
||
Riga 121:
Ricava la data da un URL a Webcite (es. www.webcitation.org/67xHmVFWP)
]]
local function
local path = mw.uri.new(url).path
local path_elements = mw.text.split(path, '/')
Riga 152:
Gestisce anche le non cifre come "re_", "-" e "*".
]]
local function
local path = mw.uri.new(url).path
if path == '' then return end
Riga 174:
--[[--------------------------< decodeArchiveisDate >-----------------------
]]
local function
local path = mw.uri.new(url).path
local path_elements = mw.text.split(path, '/')
Riga 238:
--[[--------------------------< createRendering >-----------------------
]]
local function createRendering(url_data)
Riga 267:
--[[--------------------------------------------------------------------
Entry point per chiamata diretta da un modulo.
Funzione di interfaccia principale per implementazione del▼
Riceve l'URL di un archivio e ne restituisce la data se riesce a decodificarla.
Template:Webarchive▼
]]
function p.decodeArchiveDate(url)
local host = mw.uri.new(url).host
if not url or not host then return end
host = string.gsub(host, 'www%.', '')
for _, servizio in ipairs(cfg.servizi) do
if host == servizio.signature then
if servizio.service == 'wayback' then
return decodeWaybackDate(url)
elseif servizio.service == 'webcite' then
return decodeWebciteDate(url)
elseif servizio.service == 'archiveis' then
return decodeArchiveisDate(url)
end
end
end
return
end
--[[--------------------------------------------------------------------
]]
function p.webarchive(frame)
Line 312 ⟶ 334:
if date then
date = formatDate(date)
local udate = url_data[i].service == 'wayback' and
url_data[i].service == 'webcite' and
url_data[i].service == 'archiveis' and
if udate and udate ~= date then
date = date .. ' ' .. inlineRed('Data nell\'URL non combaciante: ' .. udate, 'warning')
Line 321 ⟶ 343:
end
elseif url_data[i].service == 'wayback' then
date =
elseif url_data[i].service == 'webcite' then
date =
elseif url_data[i].service == 'archiveis' then
date =
else
date = inlineRed('Data mancante', 'warning')
|