Модуль:Webarchive: відмінності між версіями

[неперевірена версія][неперевірена версія]
Вилучено вміст Додано вміст
LordVoland (обговорення | внесок)
Створена сторінка: --[[ ---------------------------------- Lua module implementing the {{webarchive}} template. A merger of the functionality of three templates: {{...
 
LordVoland (обговорення | внесок)
Немає опису редагування
Рядок 332:
end
 
ulx.url1.service = "otherінше"
ulx.url1.tail = " atу " .. ulx.url1.host
 
if mw.ustring.find( host, "archive.org", 1, plain ) then
ulx.url1.service = "wayback"
ulx.url1.tail = " at theу " .. bracketopen .. "Wayback Machine" .. bracketclose
tracking = "Category:Webarchive template wayback links"
elseif mw.ustring.find( host, "webcitation.org", 1, plain ) then
ulx.url1.service = "webcite"
ulx.url1.tail = " atу " .. bracketopen .. "WebCite" .. bracketclose
tracking = "Category:Webarchive template webcite links"
elseif mw.ustring.find( host, "archive.is", 1, plain ) then
ulx.url1.service = "archiveisархіви"
ulx.url1.tail = " atу " .. bracketopen .. "Archive.is" .. bracketclose
tracking = "Category:Webarchive template archiveis links"
elseif mw.ustring.find( host, "archive.today", 1, plain ) then
ulx.url1.service = "archiveis"
ulx.url1.tail = " atу " .. bracketopen .. "Archive.is" .. bracketclose
tracking = "Category:Webarchive template archiveis links"
elseif mw.ustring.find( host, "archive-it", 1, plain ) then
ulx.url1.service = "archiveit"
ulx.url1.tail = " atу " .. bracketopen .. "Archive-It" .. bracketclose
elseif mw.ustring.find( host, "arquivo.pt", 1, plain) then
ulx.url1.tail = " at theу " .. "Portugese Web Archive"
elseif mw.ustring.find( host, "loc.gov", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "Library of Congress" .. bracketclose
elseif mw.ustring.find( host, "webharvest.gov", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "National Archives and Records Administration" .. bracketclose
elseif mw.ustring.find( host, "bibalex.org", 1, plain ) then
ulx.url1.tail = " atу " .. "[[Bibliotheca_Alexandrina#Internet_Archive_partnership|Bibliotheca Alexandrina]]"
elseif mw.ustring.find( host, "collectionscanada", 1, plain ) then
ulx.url1.tail = " at theу " .. "Canadian Government Web Archive"
elseif mw.ustring.find( host, "haw.nsk", 1, plain ) then
ulx.url1.tail = " at theу " .. "Croatian Web Archive (HAW)"
elseif mw.ustring.find( host, "nlib.ee", 1, plain ) then
ulx.url1.tail = " at theу " .. "Estonian Web Archive"
elseif mw.ustring.find( host, "vefsafn.is", 1, plain ) then
ulx.url1.tail = " at theу " .. "[[National and University Library of Iceland]]"
elseif mw.ustring.find( host, "proni.gov", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "Public Record Office of Northern Ireland" .. bracketclose
elseif mw.ustring.find( host, "uni-lj.si", 1, plain ) then
ulx.url1.tail = " at theу " .. "Slovenian Web Archive"
elseif mw.ustring.find( host, "stanford.edu", 1, plain ) then
ulx.url1.tail = " at theу " .. "[[Stanford University Libraries|Stanford Web Archive]]"
elseif mw.ustring.find( host, "nationalarchives.gov.uk", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "UK Government Web Archive" .. bracketclose
elseif mw.ustring.find( host, "parliament.uk", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "UK Parliament's Web Archive" .. bracketclose
elseif mw.ustring.find( host, "webarchive.org.uk", 1, plain ) then
ulx.url1.tail = " at theу " .. bracketopen .. "UK Web Archive" .. bracketclose
elseif mw.ustring.find( host, "nlb.gov.sg", 1, plain ) then
ulx.url1.tail = " atу " .. "Web Archive Singapore"
elseif mw.ustring.find( host, "nlb.gov.sg", 1, plain ) then
ulx.url1.tail = " atу " .. "Web Archive Singapore"
elseif mw.ustring.find( host, "screenshots.com", 1, plain ) then
ulx.url1.tail = " atу " .. "Screenshots"
elseif mw.ustring.find( host, "wikiwix.com", 1, plain ) then
ulx.url1.tail = " atу " .. "Wikiwix"
elseif mw.ustring.find( host, "perma.cc", 1, plain ) then
ulx.url1.tail = " atу " .. bracketopen .. "Perma.cc" .. bracketclose
else
tracking = "Category:Webarchive template unknown archives"
Рядок 428:
ulx[argurl2]["date"] = args[argdate]
else
ulx[argurl2]["date"] = inlineRed("[DateДата missingвідсутня]", "warning")
end
argtitle = "title" .. j
Рядок 504:
if ulx.url1.format == "none" then
if not ulx.url1.title and not ulx.url1.date then -- No title. No date
sand = "[" .. ulx.url1.url .. " ArchivedАрхівовано]" .. ulx.url1.tail
elseif not ulx.url1.title and ulx.url1.date then -- No title. Date.
if ulx.url1.service == "wayback" then
Рядок 510:
period2 = ""
end
sand = "[" .. ulx.url1.url .. " ArchivedАрхівовано] " .. ulx.url1.date .. comma(ulx.url1.date) .. ulx.url1.tail .. period1
elseif ulx.url1.title and not ulx.url1.date then -- Title. No date.
sand = "[" .. ulx.url1.url .. " " .. ulx.url1.title .. "]" .. ulx.url1.tail
Рядок 520:
if ulx.url1.extraurls > 0 then -- For multiple archive URLs
local tot = ulx.url1.extraurls + 1
sand = sand .. period2 .. " AdditionalДодаткові archivesархіви: "
for i=2,tot do
local indx = "url" .. i
Рядок 543:
else
if ulx.url1.format == "addlarchives" then -- Multiple archive services
displayheader = "AdditionalДодаткові archivesархіви: "
else -- Multiple pages from the same archive
displayheader = "AdditionalДодаткові pagesсторінки archivedархівовані onна " .. ulx.url1.date .. ": "
end
local tot = 1 + ulx.url1.extraurls
Рядок 558:
else
if not displayfield then
displayfield = "PageСторінка " .. i
end
end
Рядок 588:
local url1 = trimArg(args.url) or trimArg(args.url1)
if not url1 then
return inlineError("url", "EmptyПорожньо.") .. createTracking()
end
if mw.ustring.find( url1, "https://web.http", 1, plain ) then -- track bug
Рядок 617:
local udate = decodeWaybackDate( uri1.path, ldf )
if udate ~= date then
date = udate .. inlineRed("<sup>[DateДата mismatchне співпадає]</sup>", "warning")
end
end
Рядок 626:
if udate == "query" then -- skip
elseif udate ~= date then
date = udate .. inlineRed("<sup>[DateДата mismatchне співпадає]</sup>", "warning")
end
end
Рядок 632:
date = decodeWaybackDate( uri1.path, "iso" )
if not date then
date = inlineRed("[DateПомилка errorдати] (1)", "error")
end
elseif not date and ulx.url1.service == "webcite" then
date = decodeWebciteDate( uri1.path, "iso" )
if date == "query" then
date = inlineRed("[DateДата missingвідсутня]", "warning")
elseif not date then
date = inlineRed("[DateПомилка errorдати] (1)", "error")
end
elseif not date then
date = inlineRed("[DateДата missingвідсутня]", "warning")
end
ulx.url1.date = date
Рядок 672:
local rend = createRendering()
if not rend then
rend = '<span style="font-size:100%" class="error citation-comment">Error inПомилка [[:TemplateШаблон:' .. tname .. ']]: UnknownНевідома problemпроблема. Please reportПовідомте onна templateсторінці talkобговорення pageшаблону.</span>'
track["Category:Webarchive template errors"] = 1
end