This file contains 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
// ==UserScript== | |
// @name Reddit Mod Nuke Userscript | |
// @version 3.141.592.653 | |
// @include htt*://*.reddit.com/* | |
// @author djimbob (dr jimbob) | |
// @description This userscript helps reddit moderators delete threads. | |
// ==/UserScript== | |
delete_function = function(thread_root) { | |
var elmnts = document.getElementsByClassName('id-'+thread_root)[0].querySelectorAll('form input[value="removed"]~span.option.error a.yes,a[onclick^="return big_mod_action($(this), -1)"]'); |
This file contains 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
$('.comments-page .comment .flat-list.buttons').each(function () { // this targets each flat-list belonging to comments on a comment page. | |
$(this).append('<li><a class="view-source" href="javascript:void(0)">view source</a></li>'); // it then adds the view sourc button in the belonging function | |
}); | |
$('body').on('click', '.view-source', function () { // On clicking of the view source button we do what we want to do. Note that we start with body since that is a constant dom element. If you try to target added dom elements directly it will not work. | |
var $this = $(this), // We posisbly want to reuse $(this), it is cleaner to define jquery objects you want to reuse. | |
$parentThing = $this.closest('.thing'), | |
thingId = $parentThing.attr('data-fullname'); // we need an id to throw at the api, luckily it is is present in the html. | |
if($parentThing.find('#box-' + thingId).length) { // Lets see if we already did do this before. |
This file contains 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
BAD_WORDS = ['shit', 'piss', 'fuck'] | |
def run(workbookname, usernamecolletter=None, subreddit=None, badwords=[], notifyme=False, runbackgroundcheck=True, useragent=None, username=None, password=None): | |
""" | |
Main instance | |
The user that is OAuthed or LoginAuthed must be an approved contributor to the sub to post apps | |
and must be an approved submitter to the sub. Just making it a mod won't work. | |
:param usernamecolletter: the letter of the column that denotes the applicant's username. |
This file contains 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
BAD_WORDS = ['shit', 'piss', 'fuck'] | |
def run(workbookname, usernamecolletter=None, subreddit=None, badwords=[], notifyme=False, runbackgroundcheck=True, | |
useragent=None, username=None, password=None): | |
""" | |
Main instance | |
The user that is OAuthed or LoginAuthed must be an approved contributor to the sub to post apps | |
and must be an approved submitter to the sub. Just making it a mod won't work. | |
:param usernamecolletter: the letter of the column that denotes the applicant's username. |