XO Java

XO with additional PumoBlocker functionality

Stan na 22-03-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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();
})();