Add /sp/ archive redirection. Update /u/ archive redirection.

This commit is contained in:
Nicolas Stepien 2012-06-28 23:06:35 +02:00
parent 39ccd42729
commit f4f13449dc
3 changed files with 28 additions and 8 deletions

View File

@ -4013,10 +4013,12 @@
case 'a':
case 'jp':
case 'm':
case 'sp':
case 'tg':
case 'u':
case 'vg':
return "//archive.foolz.us/" + board + "/full_image/" + filename;
case 'u':
return "//nsfw.foolz.us/" + board + "/full_image/" + filename;
}
},
post: function(board, postID) {
@ -4025,15 +4027,17 @@
case 'co':
case 'jp':
case 'm':
case 'sp':
case 'tg':
case 'tv':
case 'u':
case 'v':
case 'vg':
case 'dev':
case 'foolz':
case 'kuku':
return "//archive.foolz.us/api/chan/post/board/" + board + "/num/" + postID + "/format/json";
case 'u':
case 'kuku':
return "//nsfw.foolz.us/api/chan/post/board/" + board + "/num/" + postID + "/format/json";
}
},
thread: function(board, threadID, postID) {
@ -4047,19 +4051,25 @@
case 'co':
case 'jp':
case 'm':
case 'sp':
case 'tg':
case 'tv':
case 'u':
case 'v':
case 'vg':
case 'dev':
case 'foolz':
case 'kuku':
url = "//archive.foolz.us/" + path + "/";
if (threadID && postID) {
url += "#" + postID;
}
break;
case 'u':
case 'kuku':
url = "//nsfw.foolz.us/" + path + "/";
if (threadID && postID) {
url += "#" + postID;
}
break;
case 'lit':
url = "//fuuka.warosu.org/" + path;
if (threadID && postID) {

View File

@ -1,4 +1,6 @@
master
- Mayhem
Add /sp/ archive redirection.
2.33.4
- Mayhem

View File

@ -3141,8 +3141,10 @@ Redirect =
image: (board, filename) ->
# Do not use g.BOARD, the image url can originate from a cross-quote.
switch board
when 'a', 'jp', 'm', 'tg', 'u', 'vg'
when 'a', 'jp', 'm', 'sp', 'tg', 'vg'
"//archive.foolz.us/#{board}/full_image/#{filename}"
when 'u'
"//nsfw.foolz.us/#{board}/full_image/#{filename}"
# these will work whenever https://github.com/eksopl/fuuka/issues/23 is done
# when 'cgl', 'g', 'w'
# "//archive.rebeccablacktech.com/#{board}/full_image/#{filename}"
@ -3152,8 +3154,10 @@ Redirect =
# "https://md401.homelinux.net/4chan/cgi-board.pl/#{board}/full_image/#{filename}"
post: (board, postID) ->
switch board
when 'a', 'co', 'jp', 'm', 'tg', 'tv', 'u', 'v', 'vg', 'dev', 'foolz', 'kuku'
when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', '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"
thread: (board, threadID, postID) ->
# keep the number only if the location.hash was sent f.e.
postID = postID.match(/\d+/)[0] if postID
@ -3163,10 +3167,14 @@ Redirect =
else
"#{board}/post/#{postID}"
switch board
when 'a', 'co', 'jp', 'm', 'tg', 'tv', 'u', 'v', 'vg', 'dev', 'foolz', 'kuku'
when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'dev', 'foolz'
url = "//archive.foolz.us/#{path}/"
if threadID and postID
url += "##{postID}"
when 'u', 'kuku'
url = "//nsfw.foolz.us/#{path}/"
if threadID and postID
url += "##{postID}"
when 'lit'
url = "//fuuka.warosu.org/#{path}"
if threadID and postID