Modul:Webarchiv: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Cowboy (Diskussion | Beiträge) Die Seite wurde neu angelegt: „local p = { } p.getdomain = function ( frame ) local url = frame.args[1] local domain if url:match( "^https?://[%w%-%.]*/" ) then domain = url:match( "^https?://[%w%-%.]*" ):gsub("http://", ""):gsub("https://", ""):gsub("www.", "") else domain = "Fehler" end return domain or "" end -- p.getdomain p.archiveis = function ( frame ) local timestamp = frame.args[1] local date if timestamp:match( "^20[0-9][0…“ |
(kein Unterschied)
|
Aktuelle Version vom 5. Februar 2025, 00:38 Uhr
Die Dokumentation für dieses Modul kann unter Modul:Webarchiv/Doku erstellt werden
local p = { }
p.getdomain = function ( frame )
local url = frame.args[1]
local domain
if url:match( "^https?://[%w%-%.]*/" ) then
domain = url:match( "^https?://[%w%-%.]*" ):gsub("http://", ""):gsub("https://", ""):gsub("www.", "")
else
domain = "Fehler"
end
return domain or ""
end -- p.getdomain
p.archiveis = function ( frame )
local timestamp = frame.args[1]
local date
if timestamp:match( "^20[0-9][0-9]%.[0-1][0-9]%.[0-3][0-9]%-[0-2][0-9][0-5][0-9][0-5][0-9]" ) then
date = timestamp:match( "^20[0-9][0-9]%.[0-1][0-9]%.[0-3][0-9]%-[0-2][0-9][0-5][0-9][0-5][0-9]" ):gsub("%-", ""):gsub("%.", "")
else
date = timestamp
end
return date or ""
end
return p