Add /q/ archive redirection. Close #648.

This commit is contained in:
Nicolas Stepien 2012-08-08 16:59:35 +02:00
parent 0d136c967a
commit 2de968891c
3 changed files with 8 additions and 3 deletions

View File

@ -4467,6 +4467,7 @@
case 'a':
case 'jp':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'vg':
@ -4482,6 +4483,7 @@
case 'co':
case 'jp':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'tv':
@ -4507,6 +4509,7 @@
case 'co':
case 'jp':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'tv':

View File

@ -1,4 +1,6 @@
master
- Mayhem
Add /q/ archive redirection.
2.34.3
- Mayhem

View File

@ -3551,7 +3551,7 @@ Redirect =
image: (board, filename) ->
# Do not use g.BOARD, the image url can originate from a cross-quote.
switch board
when 'a', 'jp', 'm', 'sp', 'tg', 'vg', 'wsg'
when 'a', 'jp', 'm', 'q', 'sp', 'tg', 'vg', 'wsg'
"//archive.foolz.us/#{board}/full_image/#{filename}"
when 'u'
"//nsfw.foolz.us/#{board}/full_image/#{filename}"
@ -3564,7 +3564,7 @@ Redirect =
# "https://md401.homelinux.net/4chan/cgi-board.pl/#{board}/full_image/#{filename}"
post: (board, postID) ->
switch board
when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz'
when 'a', 'co', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz'
"//archive.foolz.us/api/chan/post/board/#{board}/num/#{postID}/format/json"
when 'u', 'kuku'
"//nsfw.foolz.us/api/chan/post/board/#{board}/num/#{postID}/format/json"
@ -3577,7 +3577,7 @@ Redirect =
else
"#{board}/post/#{postID}"
switch board
when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz'
when 'a', 'co', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz'
url = "//archive.foolz.us/#{path}/"
if threadID and postID
url += "##{postID}"