This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function iota (n) { // Pretty genius implementation | |
return [...Array(n).keys()] | |
} | |
function fizzbuzz (n) { | |
return iota(30).map( x => | |
(x % 15 === 0 ? "fizzbuzz" : x % 3 == 0 ? "fizz" : x % 5 == 0 ? "buzz" : x.toString()) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw, subprocess | |
SUBREDDIT = "wallpapers" | |
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] | |
subprocess.call(['feh', "--bg-fill", urls[0]) |