Skip to content

Instantly share code, notes, and snippets.

View cpebble's full-sized avatar
👨‍🎓
Back at uni again(again)

Christian Påbøl Jacobsen cpebble

👨‍🎓
Back at uni again(again)
View GitHub Profile
import glob, praw, requests, subprocess
from pathlib import Path
SUBREDDIT = "wallpapers"
wallpaperPath = "{}/Wallpapers/".format(str(Path.home()))
files = [i.split("/")[-1] for i in glob.glob(wallpaperPath+"*")]
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() if post.url.split(".")[-1] in allowedFormats and not post.url.split("/")[-1] in files]