// ==UserScript== // @name Worm web serial comments spoiler protector // @namespace http://tampermonkey.net/ // @version 0.17 // @description Disables character tags and hides comments newer than 2 days after the chapter was published in Wildbow's web serial Worm. // @author ShareDVI // @match http://parahumans.wordpress.com/* // @match https://parahumans.wordpress.com/* // @include parahumans.wordpress.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // How many days ahead are allowed var DAYS = 2; // Get chapter release date, thank gods of semantic web var chapter = Date.parse(jQuery("time.entry-date").attr("datetime")); // If something went wrong, better kill all comments if(!chapter) chapter=0; // Filter all comments newer than days jQuery("article.comment").filter(function(i,e) {return Date.parse(jQuery(e).find("time").attr("datetime")) >= chapter + 2*86400*1000;}).hide().remove(); // Delete tags jQuery("a[rel=tag]").hide().remove(); // Add warning so that you know it's enabled jQuery("#comments-title").append("Spoiler protection on!"); })();