Module:Webarchive and Module:Webarchive/sandbox: Difference between pages
(Difference between pages)
imported>WOSlinker use require('strict') instead of require('Module:No globals') |
imported>Zyxw update pattern for finding Archive-It date |
||
| Line 371: | Line 371: | ||
Given a URI-path to Wayback (eg. /web/20160901010101/http://example.com ) | Given a URI-path to Wayback (eg. /web/20160901010101/http://example.com ) | ||
or Library of Congress Web Archives (eg. /all/20160901010101/http://example.com) | or Library of Congress Web Archives (eg. /all/20160901010101/http://example.com) | ||
or Archive-It (eg. /all/20190621232545/http://example.com or /3348/20151201214156/http://example.com or /org-467/20191016094633/http://example.com) | |||
or UK Government Web Archive (eg. /ukgwa/20160901010101/http://example.com or /tna/20160901010101/http://example.com) | or UK Government Web Archive (eg. /ukgwa/20160901010101/http://example.com or /tna/20160901010101/http://example.com) | ||
| Line 390: | Line 391: | ||
local msg, snapdate; | local msg, snapdate; | ||
snapdate = path:gsub ('^/web/', ''):gsub ('^/all/', ''):gsub ('^/ukgwa/', ''):gsub ('^/tna/', ''):gsub ('^/', ''); -- remove leading /web/, /all/, /ukgwa/, /tna/, or / | snapdate = path:gsub ('^/web/', ''):gsub ('^/all/', ''):gsub ('^/%d%d%d%d?%d?/', ''):gsub ('^/org%-%d%d%d%d?/', ''):gsub ('^/ukgwa/', ''):gsub ('^/tna/', ''):gsub ('^/', ''); -- remove leading /web/, /all/, /###/, /org-###/, /ukgwa/, /tna/, or / | ||
snapdate = snapdate:match ('^[^/]+'); -- get timestamp | snapdate = snapdate:match ('^[^/]+'); -- get timestamp | ||
if snapdate == "*" then -- eg. /web/*/http.., etc. | if snapdate == "*" then -- eg. /web/*/http.., etc. | ||
| Line 863: | Line 864: | ||
end | end | ||
if 'wayback' == ulx.url1.service or 'locwebarchives' == ulx.url1.service or 'ukgwa' == ulx.url1.service then | if 'wayback' == ulx.url1.service or 'locwebarchives' == ulx.url1.service or 'archiveit' == ulx.url1.service or 'ukgwa' == ulx.url1.service then | ||
if date then | if date then | ||
if config.verifydates then | if config.verifydates then | ||