Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Убрать посты повышал
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://forum.onliner.by/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var povishaly = ['new-comer', 'Janettka', 'Маркелыч', 'blue-sky'];
- var posts = document.getElementsByClassName('msgpost');
- // console.log(posts.length);
- for (var i = posts.length -1; i>=0; i--)
- {
- // console.log(posts[i].getElementsByClassName('_name')[0].innerText);
- if (povishaly.indexOf(posts[i].getElementsByClassName('_name')[0].innerText)!=-1)
- {
- posts[i].innerHTML = '<b>Тут был пост повышалы</b>';
- }
- }
- var quotes = document.getElementsByTagName('blockquote');
- for (var j = quotes.length -1; j>=0; j--)
- {
- var quoteAuthorElem = quotes[j].getElementsByTagName('cite')[0];
- if (quoteAuthorElem !== undefined)
- {
- var quoteAuthor = quoteAuthorElem.innerText.split(':')[0];
- // console.log("Quote by: " + quoteAuthor);
- if (povishaly.indexOf(quoteAuthor)!=-1)
- {
- // console.log("Hide: " + quoteAuthor);
- quotes[j].innerHTML = '<b>Тут была цитата повышалы</b>';
- }
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement