bbs.mottoki.com image url replacer

bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します

Version vom 26.01.2020. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name     bbs.mottoki.com image url replacer
// @version  1
// @grant    none
// @include  http*://bbs.mottoki.com/index*
// @description bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します
// @description:ja bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します
// @namespace https://greasyfork.org/users/10885
// ==/UserScript==
// exampleurl http://bbs.mottoki.com/index?bbs=kimottamakaasann&act=album&thread=&page_album=27
// exampleurl http://bbs.mottoki.com/index?bbs=kimottamakaasann&act=img&img=4965
// exampleurl http://bbs.mottoki.com/img/kimottamakaasann/1578698682-9zq398.jpg

var i = 0;
var j = 0;
var url_org = "";
var url_mod = "";
var t = [];
var u = [];

t = document.getElementsByTagName("a");
u = document.getElementsByTagName("img");

for (i = 32; i < 82; i++) {
    if (t[i] != null || t[i] != undefined) {
        console.log("i = " + i);
        if (t[i].getAttribute("href") != null || t[i].getAttribute("href") != undefined) {
            if (t[i].getAttribute("href").includes("/index?bbs=kimottamakaasann&act=img&") === true) {
                for (j = 1; j < 25; j++) {
                    console.log("j = " + j);
                    if (u[j] != null || u[j] != undefined) {
                        if (u[j].getAttribute("src") != null || u[j].getAttribute("src") != undefined) {
                            if (u[j].getAttribute("src").includes("img/kimottamakaasann/s/") === true) {
                                url_org = u[j].getAttribute("src");
                                url_mod = url_org.replace(/\/s\//, "/")
                                console.log("url_org = " + url_org + "|" + "url_mod = " + url_mod);
                                t[i].setAttribute("href", url_mod);
                            }
                        }
                    }
                }
            }
        }
    }
}