XO with additional PumoBlocker functionality
La data de
// ==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();
})();