FC - Hitman

Borra temas políticos de FC

目前为 2015-12-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         FC - Hitman
// @namespace    http://forocoches.com/
// @version      0.2
// @description  Borra temas políticos de FC
// @author       You
// @match        http://*.forocoches.com/*
// @grant        none
// ==/UserScript==
/* jshint -W097 */
'use strict';

// Your code here...
var hitman = function () {
	var words = ["Saenz de Santamaria", "Sáenz de Santamaría", "votantes", "pdr snchz", "partido político", "partido politico", "Pedro Sánchez", "Pedro Sanchez", "rajoy","soraya", "falange", "pableras","upyd", "coletas","psoe","debate", "carmena", "voto", "pablemos", "ciudadanos", "ciutadans", "discurso", "albert", "rivera", "iglesias", "elecciones", "votar", "votación", "votación", "pedro sanchez", "pedro sánchez", "podemos", "podemitas", "pp"],
	clog = [];
	
	var init = function () {
		removePoliticThreads();
	}
	
	var removePoliticThreads = function () {
		jQuery('#threadbits_forum_2 tr').each(function () {
			var title = jQuery(this).find("td[title] a").eq(1).text(),
				intro = jQuery(this).find("td[title]").attr("title"),
                k,
				word;
			
			for (k in words) {
				word = words[k];
				if (title.search(new RegExp(word, "i")) !== -1 || intro.search(new RegExp(word, "i")) !== -1 ) {
					jQuery(this).remove();
				}
			}
		});
	}
	
	return {
		init: init,
		clog: clog
	}
}();

if (typeof jQuery == "undefined")
{
	var s = document.createElement("script");
	s.type = "text/javascript";
	s.src = "//code.jquery.com/jquery-1.11.3.min.js";
	document.head.appendChild(s);

	// Electrik se peta el debugging en JS
	console.log = function () {
		for (var i = 0; i < arguments.length; i++) {
	        hitman.clog[hitman.clog.length] = arguments[i];
	    }
	}

	setTimeout(function (){
		jQuery(function() {
			hitman.init();
		});
	}, 1000);
} else {
	hitman.init();
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址