XO Java

XO with additional PumoBlocker functionality

2022/03/22のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         XO Java
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  XO with additional PumoBlocker functionality
// @author       FizzKidd
// @match        https://autoadmit.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=autoadmit.com
// @grant        none
// @license      GPLv3
// ==/UserScript==


function addGlobalStyle(css) {
   var head, style;
   head = document.getElementsByTagName('head')[0];
   if (!head) { return; }
   style = document.createElement('style');
   style.type = 'text/css';
   style.innerHTML = css;
   head.appendChild(style);
}

function delPumo() {
    const author = / /;
    const pumoAuthor = / [\\'",\.\:;]*[\\'",\.\:;]/;
    var post = document.getElementsByTagName('p');

    const linkPumoAuthor = /Serif"\>[\\'",\.\:;]*[\\'",\.\:;]\<\/font\>/;
    const image = /\<img src\="blank/;
    var postLink = document.getElementsByTagName('tr');
    //alert("number of tr elements: " + postLink.length);


    // Clean up tree
    for (let i = 1; i < postLink.length; i++) {
        if (linkPumoAuthor.test(postLink[i].innerHTML)) {
            //alert("linkPumoAuthor found");

            for (let j = i + 2; j < postLink.length; j++) {
                if (!image.test(postLink[j].innerHTML) || (image.test(postLink[i].innerHTML) && image.test(postLink[j].innerHTML) && (parseInt(postLink[j].getElementsByTagName('img')[0].getAttribute('width')) < parseInt(postLink[i].getElementsByTagName('img')[0].getAttribute('width'))))) {
                    break;
                };

                if (image.test(postLink[j].innerHTML) && (!image.test(postLink[i].innerHTML) || (parseInt(postLink[j].getElementsByTagName('img')[0].getAttribute('width')) > parseInt(postLink[i].getElementsByTagName('img')[0].getAttribute('width'))))) {
                    postLink[j].innerHTML = "";
                };

            };

            postLink[i].innerHTML = "";

        };
    };


    // Clean up posts
    for (let i = 0; i < post.length; i++) {
        if (pumoAuthor.test(post[i].innerHTML)) {

            for (let j = i + 1; j < post.length; j++) {
                if (author.test(post[j].innerHTML) && ((post[j].getElementsByTagName('td')[0].getAttribute('width') == null) || (parseInt(post[j].getElementsByTagName('td')[0].getAttribute('width')) < parseInt(post[i].getElementsByTagName('td')[0].getAttribute('width'))))) {
                   break;
                };

                if (author.test(post[j].innerHTML) && ((post[i].getElementsByTagName('td')[0].getAttribute('width') == null) || (parseInt(post[j].getElementsByTagName('td')[0].getAttribute('width')) > parseInt(post[i].getElementsByTagName('td')[0].getAttribute('width')) + 10))) {
                   post[j].innerHTML = "";
                };
            };

            post[i].innerHTML = "";

        };
    };
}

(function() {
    'use strict';
    //addGlobalStyle(`font {font-family: 'Monapo'; }`);
    delPumo();
})();