Skip to content

Instantly share code, notes, and snippets.

View NickHurst's full-sized avatar

Nick Hurst NickHurst

View GitHub Profile
import traceback
import time
import praw
import sqlite3
import urllib
import datetime
""" USER CONFIG """
FORWARD_FROM = "NotTheOnionBot"
@NickHurst
NickHurst / shower_thoughts_tk.py
Last active September 25, 2015 15:03
Displays the current hot posts on /r/ShowerThoughts via tkinter
import praw
import Tkinter as tk
class ShowerThoughtsDisplay(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
# set it to full screen, works on linux but not on OS X, untested on Windows
self.attributes('-fullscreen', True)
# sets it to full screen (but windowed) on OS X
self.geometry("{0}x{1}+0+0".format(self.winfo_screenwidth(), self.winfo_screenheight()))
import Tkinter as tk
class NameOfYourApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
# sets it to full screen (but windowed) on OS X
self.geometry("{0}x{1}+0+0".format(self.winfo_screenwidth(), self.winfo_screenheight()))
self.menubar = tk.Menu(self)
import praw
# User config
# ---------------------------------------------------------
# the file name containing usersnames to check
INFNAME = 'usernames.txt'
# the file name containing available usernames
OUTFNAME = 'avail_usersnames.txt'
# ---------------------------------------------------------

Installations

This script requires python 3, praw, and praw-oauth2util.

To install praw type in your command line:

pip install praw
pip install praw-oauth2util

Flair Reminder

Installations

This script requires python 3, praw, and praw-oauth2util.

To install praw type in your command line:

Bot Name

Installations

This script requires python 3, praw, and praw-oauth2util.

To install praw type in your command line:

import time
import praw
import sqlite3
from datetime import datetime
def archive_posts(u, sql, c):
submissions = u.get_submitted(sort='new', time='all', limit=None)
print('Archiving submissions...')
for subm in submissions:
@NickHurst
NickHurst / 0_reuse_code.js
Created November 8, 2015 00:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Bot Name

Installations

This script requires python 3, praw, and praw-oauth2util.

To install praw type in your command line: