HKMHD / 百度网页搜索 推广过滤

// ==UserScript==
// @name 			百度网页搜索 推广过滤
// @author			极品ΦωΦ小猫
// @version			0.0.3
// @description		百度网页搜索 推广过滤
// @include			/www\.baidu\.com\/((s|baidu)\?|#wd|(index.*)?$)/
// @namespace		http://bbs.maxthon.cn/thread-839877-1-2.html
// @homepage		http://bbs.maxthon.cn/thread-839877-1-2.html
// @DownloadURL		https://openuserjs.org/install/HKMHD/%E7%99%BE%E5%BA%A6%E7%BD%91%E9%A1%B5%E6%90%9C%E7%B4%A2_%E6%8E%A8%E5%B9%BF%E8%BF%87%E6%BB%A4.user.js
// @updateURL		https://openuserjs.org/install/HKMHD/%E7%99%BE%E5%BA%A6%E7%BD%91%E9%A1%B5%E6%90%9C%E7%B4%A2_%E6%8E%A8%E5%B9%BF%E8%BF%87%E6%BB%A4.user.js
// @icon			http://www.baidu.com/favicon.ico
// @run-at			document-idle
// ==/UserScript==

(function(){
    var oContent = document.getElementById('content_left');
    var oContentLen = oContent.children.length;
    var oContentParent = oContent.parentNode;
    if (oContentLen != 10 && oContentLen != 20 && oContentLen != 50 && oContentLen != 100) {
        var adlen = oContent.children[0].className.replace(/^ | $/, '').split(' ');
        for (i = oContentLen - 1; i <= oContentLen - 1 && i != -1; i--) {
			adClassLen = oContent.children[i].className.replace(/^ | $/, '').split(' ').length;
            if (adClassLen == 4 || adClassLen == 5 || (adClassLen == 3 && oContent.children[i].className.search('result','i')==-1)) {
                oContent.removeChild(oContent.children[i]);
			} else if(oContent.children[i].tagName=='BR'){
                oContent.removeChild(oContent.children[i]);
			}
        }
		
        //oContent.removeChild(oContent.firstElementChild);
        //oContent.removeChild(oContent.lastElementChild)
    }
})();