FC - Hitman

Borra temas políticos de FC

目前為 2015-12-08 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         FC - Hitman
// @namespace    https://greasyfork.org/es/scripts/14670-fc-hitman
// @version      0.3
// @description  Borra temas políticos de FC
// @author       You
// @match        http://*.forocoches.com/*
// @grant        none
// @require 	 http://code.jquery.com/jquery-latest.js
// ==/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", "votacion", "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
	}
}();

$(document).ready(function(){
	// 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];
	    }
	}

	hitman.init();
});