AutoSpamCop

GreaseMonkey script for validating SpamCop reports

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name AutoSpamCop
// @namespace   Violentmonkey Scripts
// @version	2.5
// @description	GreaseMonkey script for validating SpamCop reports
// @licence MIT License (MIT)
// @namespace Violentmonkey Scripts
// @match https://www.spamcop.net/*
// @run-at document-end
// @icon https://www.spamcop.net/images/05logo.png
// @grant none
// @date 30/08/2023
// ==/UserScript==

console.log("AutoSpamCop : Started.");

function SearchNextReport()
{
console.log("AutoSpamCop : SearchNextReport.");
var aTags = document.getElementsByTagName("a");
var searchText = "\nReport Now";
  for (var i = 0; i < aTags.length; i++) {
    if (aTags[i].textContent == searchText) {
      window.location.href = aTags[i].href;
      break;
    } 
  }
}

/* Skip too old repports  */

var content = document.body.textContent || document.body.innerText;
var hasText = content.indexOf("Sorry, this email is too old to file a spam report")!==-1;
if (hasText) {
    console.log("AutoSpamCop : too old to file, skipped.");
    SearchNextReport();
} else {
    console.log("AutoSpamCop : Process report.");
    var form = document.getElementsByName('sendreport');
    if(form[0])
      document.forms[1].submit();
    else
      SearchNextReport();
  
    console.log("AutoSpamCop : Done.");
    return;
}