【自用】EROGAMESCAPE

批评空间添加bangumi、 2d fun和百度的跳转

目前為 2022-05-31 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         【自用】EROGAMESCAPE

// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  批评空间添加bangumi、 2d fun和百度的跳转
// @author       cxhttt
// @match        https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/*game.php?game*
// @match        https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/*
// @match        https://bbs.9shenmi.com/index.php*
// @match        https://bbs.zdfx.net/search.php?mod=forum&adv=yes*
// @match        https://level-plus.net/search.php*
// @match        https://galge.fun/subjects/search?keyword=*
// @match        https://bgm.tv/subject_search/*
// @grant        GM_openInTab
// ==/UserScript==

(function() {
    'use strict';
    function pad(num, cover) {
        return String("0".repeat(cover) + num).slice(-cover);
    }
    var date = new Date();
    var year = date.getFullYear();
    var month =date.getMonth() + 1;


    if(location.href.indexOf('erogamescape')!=-1){
        if(document.querySelector("header")!=null)
            $("#container > header").after('<br><br><br>')
            else
                $('#header').after('<br><br><br>')
        $('#title > h1').append(`<br><a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_avg.php">統計表(平均値順)</a><br>`).append
        (`<a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_year_median.php?year=${year}">${year}年統計表(中央値順)</a><br>`).append
        (`<a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_hatubaibi_month.php?year=${year}&month=${pad(month,2)}"> ${year}年${month}月に発売されたゲーム</a>`)
    }

    function clickUrl(index){
    let urlList= document.querySelectorAll(index)
             for(let i =0; i< urlList.length;i++){
                 GM_openInTab(urlList[i].href,true)
             }
    }

    if(location.href.indexOf('game.php?game')!=-1){
        let name = document.querySelector("#game_title > a").innerText
        $('#soft-title').append(`<br><a href="https://bgm.tv/subject_search/${name}?cat=4#EROGAMESCAPE"
                                 class='info' target="_blank" style="text-decoration:none;">
            Bangumi</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://galge.fun/subjects/search?keyword=${name}#EROGAMESCAPE"
                                 class='info' target="_blank" style="text-decoration:none;">
            2dfun</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://bbs.9shenmi.com/index.php#search=${name}"
                                 class='resource' target="_blank"  style="text-decoration:none;">
            KFonlie</a>&nbsp;|&nbsp;`)
         $('#soft-title').append(`<a href="https://bbs.acgn.at/search/?kw=${name}&fid=0"
                                 class='resource' target="_blank"  style="text-decoration:none;">
            Kdays</a><br>`)

        $('#soft-title').append(`<a href="https://tieba.baidu.com/f/search/res?qw=${name}&sm=2&cf=1&ie=utf-8"
                                 class='info' target="_blank"  style="text-decoration:none;">
            tieba </a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://www.douban.com/search?source=suggest&q=${name}"
                                 class='info' target="_blank"  style="text-decoration:none;">
            douban</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://bbs.zdfx.net/search.php?mod=forum&adv=yes#search=${name}"
                                 target="_blank"  style="text-decoration:none;">
            zdfx</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://level-plus.net/search.php#search=${name}"
                                 target="_blank" class='resource' style="text-decoration:none;">
            level-plus</a><br>`)

        $('#soft-title').append(`<a href="https://www.baidu.com/s?wd=${name}"
                                 target="_blank"  style="text-decoration:none;">
            baidu</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://www.google.com.tw/search?q=${name}"
                                 target="_blank"  style="text-decoration:none;">
            google       </a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a href="https://search.bilibili.com/all?keyword=${name}"
                                 class='info' target="_blank"  style="text-decoration:none;">
            bilibili       </a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a target="_blank" class='info-button' style="text-decoration:none;">
            信息</a>&nbsp;|&nbsp;`)
        $('#soft-title').append(`<a target="_blank" class='resource-button' style="text-decoration:none;">
            下载</a>&nbsp;|&nbsp;`)
        document.querySelector("#soft-title > a.info-button").onclick=()=>{
            clickUrl(".info")
        }
        document.querySelector("#soft-title > a.resource-button").onclick=()=>{
            clickUrl(".resource")
        }


    }

    if(location.href == 'https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/'){
        $('#nav_2 > div > h3:nth-child(9)').append(`<a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_avg.php">統計表(平均値順)</a><br>`)
        $('#nav_2 > div > h3:nth-child(9)').append(`<a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_year_median.php?year=${year}">${year}年統計表(中央値順)</a>`)
        $('#nav_2 > div > h3:nth-child(9)').append(`<a href="https://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/toukei_hatubaibi_month.php?year=${year}&month=${pad(month,2)}"> ${year}年${month}月に発売されたゲーム</a>`)
    }

    function getName(url){
        return decodeURI(url.split('#')[1].split('=')[1]);
    }

    //绯月自动搜索
    if(location.href.indexOf('bbs.9shenmi.com/index.php')!=-1){
        document.querySelector("#alldiv > div:nth-child(3) > div:nth-child(1) > div.k_ale > form > input:nth-child(8)").value=getName(location.href)
        document.querySelector("#alldiv > div:nth-child(3) > div:nth-child(1) > div.k_ale > form > input.k_butt.k_blk.k_ansma").click()
        setTimeout(window.close(),1000);
    }

    //终点论坛自动搜索
    if(location.href.indexOf('bbs.zdfx.net/search.php?mod=forum&adv=yes')!=-1){
        document.querySelector("#srchtxt_1").value=getName(location.href)
        document.querySelector("#orderby1 > option:nth-child(2)").selected=true
        document.querySelector("#ct > div > div > div.bm_c > form > table > tbody > tr:nth-child(8) > td > button").click()
    }

    //南+自动搜索
    if(location.href.indexOf('https://level-plus.net/search.php')!=-1){
        document.querySelector("#main > form > div.t > table > tbody > tr:nth-child(3) > th:nth-child(1) > input.input").value=getName(location.href)
        document.querySelector("#main > form > div:nth-child(3) > input:nth-child(1)").click()
    }

    //2dfun自动点击搜索结果
    if(location.href.indexOf('galge.fun/subjects/search?keyword=') && location.href.indexOf('EROGAMESCAPE')!=-1){
        if(document.querySelector("#subjects > li")!=null){
            location.href=document.querySelector("#subjects > li > div > h4 > a").href
        }
    }

    //Bangumi自动点击搜索结果
    if(location.href.indexOf('bgm.tv/subject_search/') && location.href.indexOf('EROGAMESCAPE')!=-1){
        if(document.querySelector("#browserItemList > li")!=null){
            location.href=document.querySelector("#browserItemList > li").querySelector('h3>a').href
        }
    }


})();