Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ronpaul
- // @namespace http://reddit.com
- // @description Removes stories I don't want and downmods them
- // @include http://reddit.com/*
- // @include http://*.reddit.com/*
- // @include http://reddit.com/new
- // @include http://*.reddit.com/new
- // @exclude http://reddit.com/user/*
- // @exclude http://*.reddit.com/user/*
- // @exclude http://reddit.com/info/*
- // @exclude http://*.reddit.com/info/*
- // ==/UserScript==
- var rows;
- var matches=0;
- rows = document.evaluate("//*[@class='titlerow']", document, null,
- XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
- regex = /Ron Paul|Impeach|Bush|Republican|Giuliani|Radiohead/i;
- for (var i = 0; i < rows.snapshotLength; i++) {
- var row = rows.snapshotItem(i);
- var text = row.childNodes[0].innerHTML;
- if (regex.exec(text)) {
- var storyID = row.id.substr(9);
- var upmod = /upmod|downmod/i;
- if (!upmod.exec(document.getElementById('up_'+storyID).className)) {
- setTimeout("mod('"+storyID+"',0);",2000);
- matches+=1;
- }
- //row.parentNode.parentNode.parentNode.style.display='none';
- }
- }
- if (matches > 0) {
- var tbl = document.getElementById('siteTable'),
- div = document.createElement('div'),
- msg = 'Down-voted ' + matches + ' stories';
- GM_log(msg);
- if (!tbl) return;
- div.innerHTML = '<p><i>' + msg + '.</i></p>';
- tbl.parentNode.insertBefore(div, tbl);
- }
Add Comment
Please, Sign In to add comment