XO Java

XO with additional PumoBlocker functionality

Fra og med 22.03.2022. Se den nyeste version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

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