Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // sciblogskiller.user.js
- //
- // Written by: Michael Devore
- //
- // This is a Greasemonkey script.
- //
- // ==UserScript==
- // @name ScienceBlogs Killer
- // @namespace http://www.devoresoftware.com/gm/sciblogs
- // @description killfile script for ScienceBlogs
- // @include http://scienceblogs.com/*
- // @include https://*.scienceblogs.com/*
- // @version 1.0
- // ==/UserScript==
- //
- // list of people to killfile
- // follow all quoted names except last with a comma
- // this is only a sample of IDs used for testing. It is in no way a reflection on their actual posts
- var killThisIDList = [
- "Sample ID 1",
- "Sample ID 2",
- "Sample ID 3"
- ];
- function scienceBlogsKillerMain()
- {
- for (var i = 0; i < killThisIDList.length; i++)
- {
- var xpath = "//li[@class='li-comment']//span[(@class='fn') and text()=";
- xpath += "'"+killThisIDList[i] +"']";
- var spanNodes = document.evaluate(
- xpath,
- document,
- null,
- XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
- null
- );
- var count = spanNodes.snapshotLength;
- for (var j = 0; j < count; j++)
- {
- var theSpan = spanNodes.snapshotItem(j);
- if (!theSpan)
- {
- break;
- }
- var pNode = theSpan.parentNode;
- while (pNode && pNode.getAttribute('class') != "li-comment")
- {
- pNode = pNode.parentNode;
- }
- if (pNode)
- {
- pNode.style.display = "none";
- }
- }
- }
- }
- scienceBlogsKillerMain();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement