Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Select and set a random offensive wallpaper
import praw
import random
import os
from urllib.request import urlretrieve
r = praw.Reddit(user_agent='wallpapergrabber')
submissions = r.get_subreddit('offensive_wallpapers').get_hot()
urls = []
for post in submissions:
if (("1920x1080" in post.title) or ("1920 x 1080" in post.title)) and ("i.im" in post.url):
urls.append(post.url)
urlretrieve(urls[random.randint(0,len(urls))], 'image.jpg')
os.system('feh --bg-scale image.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.