Skip to content

Instantly share code, notes, and snippets.

View noeatnosleep's full-sized avatar

Isaac Rockett noeatnosleep

View GitHub Profile
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.
@prawnsalad
prawnsalad / sidebar-button.css
Last active June 23, 2016 13:57 — forked from sbarfurth/sidebar-button.css
orangechat.io sidebar button
.titlebox .usertext-body .md em a[href^="https://app.orangechat.io"] {
font-style: normal;
display: block;
text-decoration: none;
padding: 12px 12px 12px 12px;
margin: 12px 0;
border-radius: 3px;
text-align: center;
cursor: pointer;
font-size: 1.5em;
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.
$('.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.
// ==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)"]');