Spam Thread check

Spam link check

目前為 2016-01-29 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Spam Thread check
// @namespace   Sality
// @description Spam link check
// @include     *kat.cr/*
// @version     0.3 Beta
// @grant       none
// ==/UserScript==


    var pathname = window.location.pathname;
try{

    //Spam Testing script -----------------------------------------------------------------------------------------------------------------------------------------------
    if ($('ul#latestForum').length) {
        
        $('ul#latestForum li').each(function(){
            var title = $('p.latest-title',$(this)).text().trim().toLowerCase();
            if((title.indexOf('http://')!=-1)||(title.indexOf('www.')!=-1)||(title.indexOf('weight loss')!=-1)||(title.indexOf('gain muscle')!=-1)||(title.indexOf('brain pill')!=-1)||(title.indexOf('boost your memory')!=-1))
            {
                $('span.explanation',$(this)).after('<span style="padding:5px;background-color:#cc1212;color:#fff;" class="sality">&nbsp;X&nbsp;</span>');
            }
            else if((title.indexOf('congrats')!=-1)||(title.indexOf('adopt')!=-1)||(title.indexOf('latest')!=-1)||(title.indexOf('torrent')!=-1)||(title.indexOf('community')!=-1)||(title.indexOf('release')!=-1)||(title.indexOf('mod')!=-1)||(title.indexOf('request')!=-1))
            {
                $('span.explanation',$(this)).after('<span style="padding:5px;background-color:#00cc00;color:#fff;" class="sality">Ok</span>');
                
                
            }
            else
            {
                $('span.explanation',$(this)).after('<span style="padding:5px;background-color:#ff9900;color:#fff;" class="sality">&nbsp;#&nbsp;</span>');
                
                
            }
            
        });
    console.log("Probable Spamming Detection Done");    
}

    //community check-------------------------------------------------------------------------------------------------------------------------------------------------------
    
  if (pathname.indexOf('\/community\/') != -1) {
       
        //if($('table.data .showBlockJS div.markeredBlock a.cellMainLink').length)
            
            
            
            $('table.data .showBlockJS tr td:nth-child(2) div.markeredBlock').each(function(){
                
            var title = $('a.cellMainLink',$(this)).text().trim().toLowerCase();
                
            if((title.indexOf('http://')!=-1)||(title.indexOf('www.')!=-1)||(title.indexOf('weight loss')!=-1)||(title.indexOf('gain muscle')!=-1)||(title.indexOf('brain pill')!=-1)||(title.indexOf('boost your memory')!=-1)||(title.indexOf('beauty')!=-1))
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#cc1212;color:#fff;" class="sality">Spam</span>');
                     
            } 
                else if((title.indexOf('congrats')!=-1)||(title.indexOf('adopt')!=-1)||(title.indexOf('latest')!=-1)||(title.indexOf('torrent')!=-1)||(title.indexOf('release')!=-1)||(title.indexOf('mod')!=-1)||(title.indexOf('request')!=-1)||(title.indexOf('community')!=-1))
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#00cc00;color:#fff;" class="sality"> Ok </span>');
                
            }
            else
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#ff9900;color:#fff;" class="sality">Check</span>');
                   
            }         
});
        
         //community page top links----------------------------------------------------------------------------------------------------------------------------------------
                $('table[class="data clear"] div.markeredBlock').each(function(){
                    var title = $('a.cellMainLink',$(this)).text().trim().toLowerCase();
            if((title.indexOf('http://')!=-1)||(title.indexOf('www.')!=-1)||(title.indexOf('weight loss')!=-1)||(title.indexOf('gain muscle')!=-1)||(title.indexOf('brain pill')!=-1)||(title.indexOf('boost your memory')!=-1))
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#cc1212;color:#fff;" class="sality">&nbsp;X&nbsp;</span>'); 
                
            }
            else if((title.indexOf('congrats')!=-1)||(title.indexOf('adopt')!=-1)||(title.indexOf('latest')!=-1)||(title.indexOf('torrent')!=-1)||(title.indexOf('release')!=-1)||(title.indexOf('mod')!=-1)||(title.indexOf('request')!=-1)||(title.indexOf('community')!=-1))
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#00bb22;color:#fff;" class="sality">&nbsp; Ok &nbsp;</span>');
                
            }
            else
            {
                $('a.cellMainLink',$(this)).after('<span style="padding:5px;background-color:#227799;color:#fff;" class="sality">Check</span>');
                
            }
                });
   }
        
    $('table.data span.sality').css({"border-radius":"5px","margin-left":"10px"});
   $('ul#latestForum li span.sality').css({"border-radius":"5px","margin-top":"-25px","margin-left":"-5px","position":"absolute"});
}//try end
    catch(ex){
        Console.log("Error IN script /Page . Inform Sality");
        }