From c1b213b1006b17d31efb7206d6cf85306fe6bf78 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 30 Apr 2013 04:03:17 +0200 Subject: [PATCH 1/4] Update archive redirection for many boards. --- 4chan_x.user.js | 63 ++++++++++++++++++++++++++++++++----------------- changelog | 2 ++ script.coffee | 52 ++++++++++++++++++++++++++++------------ 3 files changed, 80 insertions(+), 37 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 082a82d61..2fc5742f6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4930,7 +4930,6 @@ case 'm': case 'q': case 'tg': - case 'vg': case 'vp': case 'vr': case 'wsg': @@ -4939,6 +4938,17 @@ return "//nsfw.foolz.us/" + board + "/full_image/" + filename; case 'po': return "//archive.thedarkcave.org/" + board + "/full_image/" + filename; + case 'hr': + case 'tv': + return "http://archive.4plebs.org/" + board + "/full_image/" + filename; + case 'c': + case 'w': + case 'wg': + return "//archive.nyafuu.org/" + board + "/full_image/" + filename; + case 'vg': + return "http://archive.nihil-ad-rem.net/" + board + "/full_image/" + filename; + case 'd': + return "//loveisover.me/" + board + "/full_image/" + filename; case 'ck': case 'fa': case 'lit': @@ -4947,15 +4957,12 @@ case 'cgl': case 'g': case 'mu': - case 'w': return "//rbt.asia/" + board + "/full_image/" + filename; case 'an': case 'k': case 'toy': case 'x': return "http://archive.heinessen.com/" + board + "/full_image/" + filename; - case 'c': - return "//archive.nyafuu.org/" + board + "/full_image/" + filename; } }, post: function(board, postID) { @@ -4969,22 +4976,28 @@ case 'sp': case 'tg': case 'tv': - case 'v': - case 'vg': case 'vp': case 'vr': case 'wsg': - case 'dev': - case 'foolz': - return "//archive.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID; + return "https://archive.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID; case 'u': - case 'kuku': - return "//nsfw.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID; - case 'c': + return "https://nsfw.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID; case 'int': case 'out': case 'po': return "//archive.thedarkcave.org/_/api/chan/post/?board=" + board + "&num=" + postID; + case 'hr': + case 'x': + return "http://archive.4plebs.org/_/api/chan/post/?board=" + board + "&num=" + postID; + case 'c': + case 'w': + case 'wg': + return "//archive.nyafuu.org/_/api/chan/post/?board=" + board + "&num=" + postID; + case 'v': + case 'vg': + return "http://archive.nihil-ad-rem.net/_/api/chan/post/?board=" + board + "&num=" + postID; + case 'd': + return "//loveisover.me/_/api/chan/post/?board=" + board + "&num=" + postID; } }, to: function(data) { @@ -5003,17 +5016,12 @@ case 'sp': case 'tg': case 'tv': - case 'v': - case 'vg': case 'vp': case 'vr': case 'wsg': - case 'dev': - case 'foolz': url = Redirect.path('//archive.foolz.us', 'foolfuuka', data); break; case 'u': - case 'kuku': url = Redirect.path('//nsfw.foolz.us', 'foolfuuka', data); break; case 'int': @@ -5021,6 +5029,21 @@ case 'po': url = Redirect.path('//archive.thedarkcave.org', 'foolfuuka', data); break; + case 'hr': + url = Redirect.path('http://archive.4plebs.org', 'foolfuuka', data); + break; + case 'c': + case 'w': + case 'wg': + url = Redirect.path('//archive.nyafuu.org', 'foolfuuka', data); + break; + case 'v': + case 'vg': + url = Redirect.path('http://archive.nihil-ad-rem.net', 'foolfuuka', data); + break; + case 'd': + url = Redirect.path('//loveisover.me', 'foolfuuka', data); + break; case 'ck': case 'fa': case 'lit': @@ -5028,13 +5051,12 @@ url = Redirect.path('//fuuka.warosu.org', 'fuuka', data); break; case 'diy': + case 'g': case 'sci': url = Redirect.path('//archive.installgentoo.net', 'fuuka', data); break; case 'cgl': - case 'g': case 'mu': - case 'w': url = Redirect.path('//rbt.asia', 'fuuka', data); break; case 'an': @@ -5046,9 +5068,6 @@ case 'x': url = Redirect.path('http://archive.heinessen.com', 'fuuka', data); break; - case 'c': - url = Redirect.path('//archive.nyafuu.org', 'fuuka', data); - break; default: if (threadID) { url = "//boards.4chan.org/" + board + "/"; diff --git a/changelog b/changelog index 668d9c853..d8fdec0da 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Update archive redirection for many boards. 2.39.3 - Mayhem diff --git a/script.coffee b/script.coffee index 96cb6bb09..c3439588b 100644 --- a/script.coffee +++ b/script.coffee @@ -4086,49 +4086,71 @@ Redirect = image: (board, filename) -> # Do not use g.BOARD, the image url can originate from a cross-quote. switch board - when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg' + when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vp', 'vr', 'wsg' "//archive.foolz.us/#{board}/full_image/#{filename}" when 'u' "//nsfw.foolz.us/#{board}/full_image/#{filename}" when 'po' "//archive.thedarkcave.org/#{board}/full_image/#{filename}" + when 'hr', 'tv' + "http://archive.4plebs.org/#{board}/full_image/#{filename}" + when 'c', 'w', 'wg' + "//archive.nyafuu.org/#{board}/full_image/#{filename}" + when 'vg' + "http://archive.nihil-ad-rem.net/#{board}/full_image/#{filename}" + when 'd' + "//loveisover.me/#{board}/full_image/#{filename}" when 'ck', 'fa', 'lit', 's4s' "//fuuka.warosu.org/#{board}/full_image/#{filename}" - when 'cgl', 'g', 'mu', 'w' + when 'cgl', 'g', 'mu' "//rbt.asia/#{board}/full_image/#{filename}" when 'an', 'k', 'toy', 'x' "http://archive.heinessen.com/#{board}/full_image/#{filename}" - when 'c' - "//archive.nyafuu.org/#{board}/full_image/#{filename}" post: (board, postID) -> + # XXX foolz had HSTS set for 120 days, which broke XHR+CORS+Redirection when on HTTP. + # Remove necessary HTTPS procotol in September 2013. switch board - when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg', 'dev', 'foolz' - "//archive.foolz.us/_/api/chan/post/?board=#{board}&num=#{postID}" - when 'u', 'kuku' - "//nsfw.foolz.us/_/api/chan/post/?board=#{board}&num=#{postID}" - when 'c', 'int', 'out', 'po' + when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg' + "https://archive.foolz.us/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'u' + "https://nsfw.foolz.us/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'int', 'out', 'po' "//archive.thedarkcave.org/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'hr', 'x' + "http://archive.4plebs.org/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'c', 'w', 'wg' + "//archive.nyafuu.org/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'v', 'vg' + "http://archive.nihil-ad-rem.net/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'd' + "//loveisover.me/_/api/chan/post/?board=#{board}&num=#{postID}" to: (data) -> unless data.isSearch {threadID} = data {board} = data switch board - when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg', 'dev', 'foolz' + when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg' url = Redirect.path '//archive.foolz.us', 'foolfuuka', data - when 'u', 'kuku' + when 'u' url = Redirect.path '//nsfw.foolz.us', 'foolfuuka', data when 'int', 'out', 'po' url = Redirect.path '//archive.thedarkcave.org', 'foolfuuka', data + when 'hr' + url = Redirect.path 'http://archive.4plebs.org', 'foolfuuka', data + when 'c', 'w', 'wg' + url = Redirect.path '//archive.nyafuu.org', 'foolfuuka', data + when 'v', 'vg' + url = Redirect.path 'http://archive.nihil-ad-rem.net', 'foolfuuka', data + when 'd' + url = Redirect.path '//loveisover.me', 'foolfuuka', data when 'ck', 'fa', 'lit', 's4s' url = Redirect.path '//fuuka.warosu.org', 'fuuka', data - when 'diy', 'sci' + when 'diy', 'g', 'sci' url = Redirect.path '//archive.installgentoo.net', 'fuuka', data - when 'cgl', 'g', 'mu', 'w' + when 'cgl', 'mu' url = Redirect.path '//rbt.asia', 'fuuka', data when 'an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x' url = Redirect.path 'http://archive.heinessen.com', 'fuuka', data - when 'c' - url = Redirect.path '//archive.nyafuu.org', 'fuuka', data else if threadID url = "//boards.4chan.org/#{board}/" From 77461c91f37563c3a306f2ce2c242db6486ec630 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 30 Apr 2013 04:04:18 +0200 Subject: [PATCH 2/4] Release 2.39.4. --- 4chan_x.user.js | 6 +++--- Cakefile | 2 +- changelog | 2 ++ latest.js | 2 +- script.coffee | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2fc5742f6..0f3f331ec 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.39.3 +// @version 2.39.4 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -27,7 +27,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012-2013 Nicolas Stepien * http://mayhemydg.github.io/4chan-x/ - * 4chan X 2.39.3 + * 4chan X 2.39.4 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -5841,7 +5841,7 @@ return $.globalEval(("(" + code + ")()").replace('_id_', bq.id)); }, namespace: '4chan_x.', - version: '2.39.3', + version: '2.39.4', callbacks: [], css: '\ /* dialog styling */\ diff --git a/Cakefile b/Cakefile index a96ed378a..8df549c52 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.39.3' +VERSION = '2.39.4' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index d8fdec0da..3ae38c38c 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.39.4 - Mayhem Update archive redirection for many boards. diff --git a/latest.js b/latest.js index deefc42d9..ec80c872c 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.39.3'},'*') \ No newline at end of file +postMessage({version:'2.39.4'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index c3439588b..646001c19 100644 --- a/script.coffee +++ b/script.coffee @@ -4750,7 +4750,7 @@ Main = $.globalEval "(#{code})()".replace '_id_', bq.id namespace: '4chan_x.' - version: '2.39.3' + version: '2.39.4' callbacks: [] css: ' /* dialog styling */ From cb3623eca3726347d61e3c14f2d03987c5729f0a Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 11 May 2013 18:59:06 +0200 Subject: [PATCH 3/4] Update archive redirection for even more boards. --- changelog | 2 ++ script.coffee | 58 ++++++++++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/changelog b/changelog index 3ae38c38c..aae7b20fc 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Update archive redirection for even more boards. 2.39.4 - Mayhem diff --git a/script.coffee b/script.coffee index 646001c19..1c58d0708 100644 --- a/script.coffee +++ b/script.coffee @@ -4092,20 +4092,22 @@ Redirect = "//nsfw.foolz.us/#{board}/full_image/#{filename}" when 'po' "//archive.thedarkcave.org/#{board}/full_image/#{filename}" - when 'hr', 'tv' + when 'hr', 'tv', 'x' "http://archive.4plebs.org/#{board}/full_image/#{filename}" when 'c', 'w', 'wg' "//archive.nyafuu.org/#{board}/full_image/#{filename}" - when 'vg' - "http://archive.nihil-ad-rem.net/#{board}/full_image/#{filename}" - when 'd' + when 'd', 'h', 'v' "//loveisover.me/#{board}/full_image/#{filename}" - when 'ck', 'fa', 'lit', 's4s' - "//fuuka.warosu.org/#{board}/full_image/#{filename}" + when 'vg' + "http://nth.pensivenonsen.se/#{board}/full_image/#{filename}" + when 'adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y' + "//archive.foolzashit.com/#{board}/full_image/#{filename}" when 'cgl', 'g', 'mu' "//rbt.asia/#{board}/full_image/#{filename}" - when 'an', 'k', 'toy', 'x' + when 'an', 'k', 'toy' "http://archive.heinessen.com/#{board}/full_image/#{filename}" + when '3', 'ck', 'fa', 'ic', 'lit' + "//fuuka.warosu.org/#{board}/full_image/#{filename}" post: (board, postID) -> # XXX foolz had HSTS set for 120 days, which broke XHR+CORS+Redirection when on HTTP. # Remove necessary HTTPS procotol in September 2013. @@ -4120,37 +4122,41 @@ Redirect = "http://archive.4plebs.org/_/api/chan/post/?board=#{board}&num=#{postID}" when 'c', 'w', 'wg' "//archive.nyafuu.org/_/api/chan/post/?board=#{board}&num=#{postID}" - when 'v', 'vg' - "http://archive.nihil-ad-rem.net/_/api/chan/post/?board=#{board}&num=#{postID}" - when 'd' + when 'd', 'h', 'v' "//loveisover.me/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'vg' + "http://nth.pensivenonsen.se/_/api/chan/post/?board=#{board}&num=#{postID}" + when 'adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y' + "//archive.foolzashit.com/_/api/chan/post/?board=#{board}&num=#{postID}" to: (data) -> unless data.isSearch {threadID} = data {board} = data switch board when 'a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg' - url = Redirect.path '//archive.foolz.us', 'foolfuuka', data + url = Redirect.path '//archive.foolz.us', 'foolfuuka', data when 'u' - url = Redirect.path '//nsfw.foolz.us', 'foolfuuka', data + url = Redirect.path '//nsfw.foolz.us', 'foolfuuka', data when 'int', 'out', 'po' - url = Redirect.path '//archive.thedarkcave.org', 'foolfuuka', data - when 'hr' - url = Redirect.path 'http://archive.4plebs.org', 'foolfuuka', data + url = Redirect.path '//archive.thedarkcave.org', 'foolfuuka', data + when 'hr', 'x' + url = Redirect.path 'http://archive.4plebs.org', 'foolfuuka', data when 'c', 'w', 'wg' - url = Redirect.path '//archive.nyafuu.org', 'foolfuuka', data - when 'v', 'vg' - url = Redirect.path 'http://archive.nihil-ad-rem.net', 'foolfuuka', data - when 'd' - url = Redirect.path '//loveisover.me', 'foolfuuka', data - when 'ck', 'fa', 'lit', 's4s' - url = Redirect.path '//fuuka.warosu.org', 'fuuka', data + url = Redirect.path '//archive.nyafuu.org', 'foolfuuka', data + when 'd', 'h', 'v' + url = Redirect.path '//loveisover.me', 'foolfuuka', data + when 'vg' + url = Redirect.path 'http://nth.pensivenonsen.se', 'foolfuuka', data + when 'adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y' + url = Redirect.path '//archive.foolzashit.com', 'foolfuuka', data when 'diy', 'g', 'sci' - url = Redirect.path '//archive.installgentoo.net', 'fuuka', data + url = Redirect.path '//archive.installgentoo.net', 'fuuka', data when 'cgl', 'mu' - url = Redirect.path '//rbt.asia', 'fuuka', data - when 'an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x' - url = Redirect.path 'http://archive.heinessen.com', 'fuuka', data + url = Redirect.path '//rbt.asia', 'fuuka', data + when 'an', 'fit', 'k', 'mlp', 'r9k', 'toy' + url = Redirect.path 'http://archive.heinessen.com', 'fuuka', data + when '3', 'ck', 'fa', 'ic', 'lit' + url = Redirect.path '//fuuka.warosu.org', 'fuuka', data else if threadID url = "//boards.4chan.org/#{board}/" From ecd111ea6cc2b43bf2458dfd2829bbd9a120f3a1 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 11 May 2013 18:59:21 +0200 Subject: [PATCH 4/4] Release 2.39.5. --- 4chan_x.user.js | 6 +++--- Cakefile | 2 +- changelog | 2 ++ latest.js | 2 +- script.coffee | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0f3f331ec..2d813fe86 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.39.4 +// @version 2.39.5 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -27,7 +27,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012-2013 Nicolas Stepien * http://mayhemydg.github.io/4chan-x/ - * 4chan X 2.39.4 + * 4chan X 2.39.5 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -5841,7 +5841,7 @@ return $.globalEval(("(" + code + ")()").replace('_id_', bq.id)); }, namespace: '4chan_x.', - version: '2.39.4', + version: '2.39.5', callbacks: [], css: '\ /* dialog styling */\ diff --git a/Cakefile b/Cakefile index 8df549c52..9c25140f4 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.39.4' +VERSION = '2.39.5' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index aae7b20fc..2c8d39353 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.39.5 - Mayhem Update archive redirection for even more boards. diff --git a/latest.js b/latest.js index ec80c872c..30b8eefce 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.39.4'},'*') \ No newline at end of file +postMessage({version:'2.39.5'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index 1c58d0708..302d99bec 100644 --- a/script.coffee +++ b/script.coffee @@ -4756,7 +4756,7 @@ Main = $.globalEval "(#{code})()".replace '_id_', bq.id namespace: '4chan_x.' - version: '2.39.4' + version: '2.39.5' callbacks: [] css: ' /* dialog styling */