Skip to content

Instantly share code, notes, and snippets.

@dmarx
dmarx / LinkFixerClone.py
Last active January 19, 2021 02:20
A simple LinkFixerBot clone developed as a demonstration for anyone who is curious how a simple reddit bot might be coded. To kill this code, spam "Ctrl+C" until it catches the exception.
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)