Auto jmup into wooyun mirror site

Auto jmup into mirror-site of wooyun from www.wooyun.org

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          Auto jmup into wooyun mirror site
// @name:zh-TW   烏雲自動跳轉
// @namespace    HTTP://WWW.RUSSIAVK.COM/
// @version      0.2
// @description  Auto jmup into mirror-site of wooyun from www.wooyun.org
// @description:zh-TW 烏雲自動跳轉到鏡像網站
// @author       WWW.RUSSIAVK.CN
// @supportURL   [email protected]
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Greasy+Fork+donation
// @match        http://www.wooyun.org/*
// @require      https://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
    'use strict';
    let d=document,
        href=location.href.replace('wooyun.org','anquan.us/static')+'.html',
        TestUrl,
        r,
        index=href.substr(href.indexOf('1')+1,1),
        find="location.href=href;console.log('找到了');",
        UnFind="console.log('此链接错误开始');";
        r=Cheak(href);
    console.log(href);
    if(r!==true){
        eval(UnFind);
        Auto(index);
    }
    else{
        eval(find);
    }
    function Auto(index){
        for(let i=0;i<=5;i++){
            if(i!==index){//continue;
                TestUrl=href.replace('1'+index,'1'+i);
                console.log(TestUrl);
                if(Cheak(TestUrl)==true){
                    find=find.replace('=href','="'+TestUrl+'"');
                    eval(find);
                }
                else{
                    eval(UnFind.replace('开始',''));
                }
            }
        }
    }
    function Cheak(URL){
        $.ajax({
            type: 'GET',
            url:URL,
            async:false,
            success:function(data,statusTXT){
                r=true;
            }
        });
        return r
    }
})();