Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Arayam-yam-yam
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description you can hide everything!
- // @author Arayam
- // @match https://tjournal.ru/*
- // @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Нужно указать имя пользователя и его id на TJ.
- var users = {
- "arayam": 126048
- };
- // Слова для блокировки постов
- var words = ['рэп', 'Оксимирон', 'медуза'];
- // Елемент замещения блокированных комментов
- var element = '<div class="comments__item"><p class="comments__item__user__removed_title">Комментарии скрыт</p> </div>';
- setInterval(remove, 3000);
- $(document).ready(function() {
- setTimeout(function () {
- remove_posts();
- remove_user_posts();
- },1500);
- remove_posts();
- $(document).on( "click", function() {
- setTimeout(function () {
- remove_posts();
- remove_user_posts();
- },1500);
- });
- });
- function remove() {
- remove_comments();
- remove_comments_from_wall();
- remove_notifications_from_wall();
- remove_notifications_from_bar();
- }
- function remove_comments() {
- $.each(users, function( name, id ) {
- var comment = ".comments__item__user[href='https://tjournal.ru/users/" + id + "']";
- $(".comments__body").find(comment).parent().parent().replaceWith(element);
- });
- }
- function remove_comments_from_wall() {
- $.each(users, function( name, id ) {
- var wall_comment = ".live__item__user[href='/users/"+ id +"']";
- $(".live__content").find(wall_comment).closest(".live__item").hide();
- });
- }
- function remove_notifications_from_wall()
- {
- $.each(users, function( name, id ) {
- var notification = ".live__item__name span:contains('" + name +"')";
- $(".live__content").find(notification).parent().parent().hide();
- });
- }
- function remove_notifications_from_bar()
- {
- $.each(users, function( name, id ) {
- var notification = ".notification__text span[name=js-notification-user]:contains('" + name +"')";
- $(".head-notifies__panel").find(notification).parent().parent().hide();
- });
- }
- function remove_user_posts()
- {
- $.each(users, function( name, id ) {
- var post = ".entry_header__author[href='https://tjournal.ru/users/" + id + "']";
- $(".feed__container").find(post).closest(".feed__item").hide();
- });
- }
- function remove_posts()
- {
- $('.b-article h2 span').each(function( index ) {
- var title = $( this ).text();
- var title_low = title.toLowerCase();
- $.each(words, function( index, word ) {
- var word_low = word.toLowerCase();
- var includes = title_low.includes(word_low);
- if (includes === true) {
- var post = ".b-article h2 span:contains('" + title +"')";
- $(".feed__container").find(post).closest(".feed__item").hide();
- }
- });
- });
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment