DM1080_to_ZZZ

('-')emmm

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         DM1080_to_ZZZ
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  ('-')emmm
// @author       Anxietier
// @match        *dm1080p.com/archives*
// @match        *52kbd.com/archives*
// @grant        none
// ==/UserScript==

(function() {
    var Spans = document.querySelectorAll('.entry-content span')
    var Temp = "";
    for(var i in Spans) {
        var Str = Spans[i].innerText;
        var N1 = Str.indexOf('资料编号:');
        var N2 = Str.indexOf('资料编码:');
        if (N1>=0 || N2>=0) {
            var str = Str. substr((N1>=0?N1:N2)+5,7);
            if (Temp != str){
                var Btn1;
                var Url1 = "https:\/\/www.zzzpan.com\/?\/file\/view-" +str+ ".html";
                (Btn1 = document.createElement("button")).innerHTML = "外链1";
                Btn1.setAttribute("onclick", "window.open('"+Url1+"');");
                Btn1.setAttribute("style", "margin-left:15px;margin-right:15px;");
                Spans[i].appendChild(Btn1);

                var Btn2;
                var Url2 = "https:\/\/zz.52kbd.com\/?\/file\/view-" +str+ ".html";
                (Btn2 = document.createElement("button")).innerHTML = "外链2";
                Btn2.setAttribute("onclick", "window.open('"+Url2+"');");
                Btn2.setAttribute("style", "margin-left:15px;margin-right:15px;");
                Spans[i].appendChild(Btn2);

                Temp = str;
            }
        }
    }
})();