Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Idiots = [//По имени фильтруем,
- 'Вадим Гофман',
- 'Vadim Kraev',
- 'Фёдор Хан',
- 'Ivan Podorozhny',
- 'Jesus Mc Saur',
- 'Alexey Chernyavskiy',
- 'Барак' // или всех по имени Барак....
- ];
- var IdiotsID = [ // По ID фильтруем, чтоб наверняка
- '23946',//Вадим Гофман
- '4088',//Vadim Kraev, интересно а все вадимы мудаки?
- '12428',//Daria
- '47839'//Фёдор
- ];
- var ratingToDelete = -10; // после какого рейтинга сносим комментарий
- var ratingToHide = -5; // после какого рейтинга делаем комментарий прозрачным
- $("div.comment").each(function( index ) {
- var comment = $( this );
- var username = comment.find("a.b-comment__user").find("span").text();
- var user_id = comment.find("a.b-comment__user").attr("href");
- comment.find("div.rating").each(function( index ) {
- count = parseInt($( this ).find("div.rating-count").text().trim().replace("–","-"));
- if(count < ratingToHide){
- console.log("Тухлый комментарий от " + username + " будет прозрачным." );
- $(comment).css("opacity","0.1").css("background-color",'pink');
- }else if(count < ratingToDelete){
- console.log("Ну очень тухлый комментарий от " + username + " будет скрыт." );
- $(comment).css("display","none");
- }
- });
- for(var i=0;i<IdiotsID.length;i++){
- var patt = new RegExp(IdiotsID[i],"i");
- if(patt.test(user_id)){
- console.log("Не желательный польщователь с ID #" + IdiotsID[i] + " (" + username + ") обнаружен, скрываем.");
- $(comment).css("display","none");
- }
- }
- for(i=0;i<Idiots.length;i++){
- patt = new RegExp(Idiots[i],"i");
- if(patt.test(username)){
- console.log("Не желательный пользователь " + Idiots[i] + " обнаружен, скрываем.");
- $(comment).css("display","none");
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment