Skip to content

Instantly share code, notes, and snippets.

View TRSGuy's full-sized avatar

Kim TRSGuy

  • Stockholm, Sweden
View GitHub Profile
import praw, subprocess, pathlib
SUBREDDIT = "wallpapers"
pp = "{}/.prevwall".format(str(pathlib.Path.home())) # this is where the previously used wallpaper links are stored
previousImages = [] # This is where the urls of previously used images will be stored
r = praw.Reddit(client_id="",
client_secret="",
user_agent="WallpaperGrabber by /u/ParanoidBox")
allowedFormats = ['jpg', 'png']
urls = [post.url for post in r.subreddit(SUBREDDIT).hot(limit=5) if post.url.split(".")[-1] in allowedFormats and !(in previousImages)post.url]