Module:Webarchive: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
change plain-> true / check for missing URL protocol as mw.uri.new() requires
சி wayback -->வந்தவழி இயந்திரம்
வரிசை 198:
return year .. "-" .. zmonth .. "-" .. zday -- 2016-09-01
elseif df == "ymd" then
return year .. " " .. nmonth .. " " .. daycday -- 2016 September 1
else
return nmonth .. " " .. day .. ", " .. year -- September 1, 2016
வரிசை 219:
 
-- valid URL formats that are not base62
-- http://www.webcitation.org/query?id=1138911916587475
 
-- http://www.webcitation.org/query?id=1138911916587475
-- http://www.webcitation.org/query?url=http..&date=2012-06-01+21:40:03cache/73e53dd1f16cf8c5da298418d2a6e452870cf50e
if dt.split[2] == "query" or dt.split[2] == "cache" or tonumber(dt.split[2]) then
-- http://www.webcitation.org/1138911916587475
-- http://www.webcitation.org/cache/73e53dd1f16cf8c5da298418d2a6e452870cf50e
-- http://www.webcitation.org/getfile.php?fileid=1c46e791d68e89e12d0c2532cc3cf629b8bc8c8e
 
if mw.ustring.find( dt.split[2], "query", 1, true) or
mw.ustring.find( dt.split[2], "cache", 1, true) or
mw.ustring.find( dt.split[2], "getfile", 1, true) or
tonumber(dt.split[2]) then
return "query"
end
வரி 250 ⟶ 243:
end
 
local fulldate = makeDate(dt.year, dt.month, dt.day, df)
if not fulldate then
return inlineRed("[Date error] (4)", "error")
வரி 259 ⟶ 252:
end
 
--[[--------------------------< decodeWaybackDatesnapDateToString >-----------------------
 
Given a URI-path to Wayback (eg. /web/20160901010101/http://example.com )
or Library of Congress Web Archives (/all/20160901010101/http://example.com)
return the formatted date eg. "September 1, 2016" in df format
Handle non-digits in snapshot ID such as "re_" and "-" and "*"
வரி 273 ⟶ 265:
 
local safe = path
snapdate = string.gsub(safe, "^/all/", "") -- Remove leading "/all/"
safe = snapdate
snapdate = string.gsub(safe, "^/w?e?b?/?", "") -- Remove leading "/web/" or "/"
safe = snapdate
local N = mw.text.split(safe, "/")
snapdate = N[1]
if snapdate == "*" then -- eg. /web/*/http.. or /all/*/http..
return "index"
end
வரி 323 ⟶ 313:
 
end
 
--[[--------------------------< decodeArchiveisDate >-----------------------
 
Given an Archive.is "long link" URI-path (e.g. /2016.08.28-144552/http://example.com)
return the date in df format (e.g. if df = dmy, return 28 August 2016)
Handles "." and "-" in snapshot date, so 2016.08.28-144552 is same as 20160828144552
 
]]
 
local function decodeArchiveisDate(path, df)
 
local snapdate, snapdatelong, currdate, fulldate
 
local safe = path
local N = mw.text.split(safe, "/")
safe = N[2] -- get snapshot date, e.g. 2016.08.28-144552
snapdate = string.gsub(safe, "[%.%-]", "") -- remove periods and hyphens
 
if not tonumber(snapdate) then -- if not numeric, it is "short link", not date
return "short link" -- e.g. http://archive.is/hD1qz
end
 
local dlen = string.len(snapdate)
if dlen < 4 then
return inlineRed("[Date error] (3)", "error")
end
if dlen < 14 then
snapdatelong = snapdate .. string.rep("0", 14 - dlen)
else
snapdatelong = snapdate
end
local year = string.sub(snapdatelong, 1, 4)
local month = string.sub(snapdatelong, 5, 6)
local day = string.sub(snapdatelong, 7, 8)
if not tonumber(year) or not tonumber(month) or not tonumber(day) then
return inlineRed("[Date error] (4)", "error")
end
if tonumber(month) > 12 or tonumber(day) > 31 or tonumber(month) < 1 then
return inlineRed("[Date error] (5)", "error")
end
currdate = os.date("%Y")
if tonumber(year) > tonumber(currdate) or tonumber(year) < 1900 then
return inlineRed("[Date error] (6)", "error")
end
 
fulldate = makeDate(year, month, day, df)
if not fulldate then
return inlineRed("[Date error] (7)", "error")
else
return fulldate
end
 
end
 
 
வரி 396 ⟶ 333:
 
ulx.url1.service = "other"
ulx.url1.tail = " at " .. ulx.url1.host .. " " .. inlineRed("Error: unknown archive URL")
 
if mw.ustring.find( host, "archive.org", 1, plain ) then
host = string.lower(host)
 
if mw.ustring.find( host, "europarchive.org", 1, true ) then -- any containing "archive.org" listed before Wayback to avoid disambiguation
ulx.url1.tail = " at the " .. bracketopen .. "National Library of Ireland" .. bracketclose
elseif mw.ustring.find( host, "webarchive.org.uk", 1, true ) then
ulx.url1.tail = " at the " .. bracketopen .. "UK Web Archive" .. bracketclose
elseif mw.ustring.find( host, "archive.org", 1, true ) 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, trueplain ) 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, trueplain ) 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.fotoday", 1, trueplain ) 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-it", 1, trueplain ) 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.li", 1, true ) 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.ec", 1, true ) 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.org", 1, true ) then
ulx.url1.service = "archiveit"
ulx.url1.tail = " at " .. bracketopen .. "Archive-It" .. bracketclose
elseif mw.ustring.find( host, "wikiwixarquivo.compt", 1, true plain) then
ulx.url1.tail = " at Wikiwixthe " .. "Portugese Web Archive"
elseif mw.ustring.find( host, "arquivoloc.ptgov", 1, trueplain ) then
ulx.url1.tail = " at the " .. "Portuguese Web Archive"
elseif mw.ustring.find( host, "webarchive.loc.gov", 1, true ) then
ulx.url1.service = "locwebarchives"
ulx.url1.tail = " at the " .. bracketopen .. "Library of Congress" .. bracketclose .. " Web Archives"
elseif mw.ustring.find( host, "loc.gov", 1, true ) then
ulx.url1.tail = " at the " .. bracketopen .. "Library of Congress" .. bracketclose
elseif mw.ustring.find( host, "webharvest.gov", 1, trueplain ) then
ulx.url1.tail = " at the " .. bracketopen .. "National Archives and Records Administration" .. bracketclose
elseif mw.ustring.find( host, "bibalex.org", 1, trueplain ) then
ulx.url1.tail = " at " .. "[[Bibliotheca_Alexandrina#Internet_Archive_partnership|Bibliotheca Alexandrina]]"
elseif mw.ustring.find( host, "collectionscanada", 1, trueplain ) then
ulx.url1.tail = " at the " .. "Canadian Government Web Archive"
elseif mw.ustring.find( host, "haw.nsk", 1, trueplain ) then
ulx.url1.tail = " at the " .. "Croatian Web Archive (HAW)"
elseif mw.ustring.find( host, "veebiarhiiv.digarnlib.ee", 1, trueplain ) then
ulx.url1.tail = " at the " .. "Estonian Web Archive"
elseif mw.ustring.find( host, "vefsafn.is", 1, trueplain ) then
ulx.url1.tail = " at the " .. "[[National and University Library of Iceland]]"
elseif mw.ustring.find( host, "proni.gov", 1, trueplain ) then
ulx.url1.tail = " at the " .. bracketopen .. "Public Record Office of Northern Ireland" .. bracketclose
elseif mw.ustring.find( host, "uni-lj.si", 1, trueplain ) then
ulx.url1.tail = " at the " .. "Slovenian Web Archive"
elseif mw.ustring.find( host, "stanford.edu", 1, trueplain ) then
ulx.url1.tail = " at the " .. "[[Stanford University Libraries|Stanford Web Archive]]"
elseif mw.ustring.find( host, "nationalarchives.gov.uk", 1, trueplain ) then
ulx.url1.tail = " at the " .. bracketopen .. "UK Government Web Archive" .. bracketclose
elseif mw.ustring.find( host, "parliament.uk", 1, trueplain ) then
ulx.url1.tail = " at the " .. bracketopen .. "UK Parliament's Web Archive" .. bracketclose
elseif mw.ustring.find( host, "nlbwebarchive.govorg.sguk", 1, trueplain ) 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, "pandora.nlanlb.gov.ausg", 1, trueplain ) then
ulx.url1.tail = " at " .. bracketopen .. "PandoraWeb Archive Singapore" .. bracketclose
elseif mw.ustring.find( host, "permascreenshots.cccom", 1, trueplain ) then
ulx.url1.tail = " at " .. bracketopen .. "Perma.ccScreenshots" .. bracketclose
elseif mw.ustring.find( host, "perma-archiveswikiwix.cccom", 1, trueplain ) then
ulx.url1.tail = " at " .. "Wikiwix"
elseif mw.ustring.find( host, "perma.cc", 1, plain ) then
ulx.url1.tail = " at " .. bracketopen .. "Perma.cc" .. bracketclose
elseif mw.ustring.find( host, "screenshots.com", 1, true ) then
ulx.url1.tail = " at Screenshots"
elseif mw.ustring.find( host, "freezepage.com", 1, true ) then
ulx.url1.tail = " at Freezepage"
elseif mw.ustring.find( host, "yorku.ca", 1, true ) then
ulx.url1.tail = " at " .. "[[York University Libraries|York University Digital Library]]"
elseif mw.ustring.find( host, "webcache.googleusercontent.com", 1, true ) then
ulx.url1.tail = " at Google Cache"
elseif mw.ustring.find( host, "timetravel.mementoweb.org", 1, true ) then
ulx.url1.tail = " at " .. bracketopen .. "Memento Project" .. bracketclose
elseif mw.ustring.find( host, "langzeitarchivierung.bib-bvb.de", 1, true ) then
ulx.url1.tail = " at " .. bracketopen .. "Bavarian State Library" .. bracketclose
elseif mw.ustring.find( host, "webrecorder.io", 1, true ) then
ulx.url1.tail = " at " .. bracketopen .. "webrecorder.io" .. bracketclose
else
tracking = "Category:Webarchive template unknown archives"
வரி 686 ⟶ 590:
return inlineError("url", "Empty.") .. createTracking()
end
if mw.ustring.find( url1, "https://web.http", 1, trueplain ) then -- track bug
track["Category:Webarchive template errors"] = 1
return inlineError("url", "https://web.http") .. createTracking()
end
if url1 == "https://web.archive.org/http:/" then -- track bug
track["Category:Webarchive template errors"] = 1
return inlineError("url", "Invalid URL") .. createTracking()
end
 
ulx.url1 = {}
ulx.url1.url = url1
if not mw.ustring.find( mw.ustring.lower(url1), "^http") then
if not mw.ustring.find( url1, "^//") then
ulx.url1.url = "http://" .. url1
end
end
local uri1 = mw.uri.new(ulx.url1.url)
ulx.url1.host = uri1.host
வரி 715 ⟶ 610:
 
local date = trimArg(args.date) or trimArg(args.date1)
if date == "*" and (ulx.url1.service == "wayback" or ulx.url1.service == "locwebarchives") then
date = "index"
elseif date and (ulx.url1.service == "wayback" or ulx.url1.service == "locwebarchives") and verifydates == "yes" then
local ldf = dateFormat(date)
if ldf then
வரி 734 ⟶ 629:
end
end
elseif not date and ulx.url1.service == "archiveis" and verifydates == "yeswayback" then
local ldf = dateFormat(date)
if ldf then
local udate = decodeArchiveisDate( uri1.path, ldf )
if udate == "short link" then -- skip
elseif udate ~= date then
date = udate .. inlineRed("<sup>[Date mismatch]</sup>", "warning")
end
end
elseif not date and (ulx.url1.service == "wayback" or ulx.url1.service == "locwebarchives") then
date = decodeWaybackDate( uri1.path, "iso" )
if not date then
வரி 755 ⟶ 641:
date = inlineRed("[Date error] (1)", "error")
end
elseif not date and ulx.url1.service == "archiveis" then
date = decodeArchiveisDate( uri1.path, "iso" )
if date == "short link" 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")
"https://tamilar.wiki/w/Module:Webarchive" இலிருந்து மீள்விக்கப்பட்டது