Created
October 6, 2014 16:32
-
-
Save julienchastang/09bdbebb8d4f27f744c6 to your computer and use it in GitHub Desktop.
javascript for dealing with mailman spam
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Open JS console ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
| // 2. Copy the following code in and execute | |
| (function () { | |
| function loadScript(url, callback) { | |
| var script = document.createElement("script") | |
| script.type = "text/javascript"; | |
| if (script.readyState) { //IE | |
| script.onreadystatechange = function () { | |
| if (script.readyState == "loaded" || script.readyState == "complete") { | |
| script.onreadystatechange = null; | |
| callback(); | |
| } | |
| }; | |
| } else { //Others | |
| script.onload = function () { | |
| callback(); | |
| }; | |
| } | |
| script.src = url; | |
| document.getElementsByTagName("head")[0].appendChild(script); | |
| } | |
| loadScript("https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function () { | |
| console.log('jquery loaded'); | |
| // Add so and so to rejects folder | |
| $( "input[name*='senderfilter']" ).prop("checked", true); | |
| $( "input[name*='senderbanp']" ).prop("checked", true); | |
| // Reject! | |
| jQuery.map($(":radio[value=2]"), function (element) { jQuery(element).attr('checked', 'checked')}); | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment