Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_header_proc do
if /\A(?:latest|day|month|nyear)\z/ =~ @mode
array = []
date = nil
@conf.cgi.params.each do |k, v|
date = v.join if v.join =~ /(\d\d\d\d){1,2}/
array << "#{k}=#{v.join}"
end
if date
params = "#{date}.html"
else
params = array.any? ? "?#{array.join(';')}" : ''
end
%Q|<meta http-equiv="refresh" content="0;URL=http://www.tamoot.net/d/#{params}">|
else
''
end
en
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment