Skip to content

Instantly share code, notes, and snippets.

@goodpic
Created August 31, 2010 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goodpic/559159 to your computer and use it in GitHub Desktop.
Save goodpic/559159 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name MT Disable Spam Users
// @description Display URL and email address and check keywords to delete spam users.
// @include http://YOUR-MT-DOMAIN/cgi-bin/mt/mt.cgi*
// ==/UserScript==
var $;
// Add jQuery
(function(){
if (typeof unsafeWindow.jQuery == 'undefined') {
var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement,
GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js';
GM_JQ.type = 'text/javascript';
GM_JQ.async = true;
GM_Head.insertBefore(GM_JQ, GM_Head.firstChild);
}
GM_wait();
})();
// Check if jQuery's loaded
function GM_wait() {
if (typeof unsafeWindow.jQuery == 'undefined') {
window.setTimeout(GM_wait, 100);
} else {
$ = unsafeWindow.jQuery.noConflict(true);
letsJQuery();
}
}
// All your GM code must be inside this function
function letsJQuery() {
console.debug("jQuery Loaded : ver. " + $().jquery); // check jQuery version
// $('#author-listing-table tbody tr').each( function (i, user){
// console.debug($(user).children());
// $(this).html("<br />" + $(this).attr('href') + "<br />")
// });
$('.status-link a').each( function (i){
url = $(this).attr('href');
$(this).html(url + "<br />");
if ( url.match(/game|loan|sex|insurance|creditcard|casino|cheap|money|diet|pharmacy|gold|googletopsearch|fundraise|dental|london-bus-hire|poker|canser|aircharter|realestate|bankrupt|budget|workout|google\.com|acai|income|gzm\.es|customparts4|acne|health|clinic|adult|seoand|sale|success|dating|fuck|porn|affiliate|buy|acupunct|affordable|bwwide|limousine|airport|gun|alcohol|drug/i) ) {
$(this).parents(':eq(2)').children('td.cb').children('input').attr("checked", true);
} else {
$(this).parents(':eq(2)').children('td.cb').children('input').attr("checked", false);
}
});
$('.status-email a').each( function (i){
url = $(this).attr('href');
$(this).html("<br />" + url + "<br />");
if ( url.match(/yahoo\.cn|adult|sex|fuck|porn|affiliate|adword|advertise|airlineticket|airport|alcohol/i) ) {
$(this).parents(':eq(2)').children('td.cb').children('input').attr("checked", true);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment