dotfiles-remastered/.local/share/scripts/reddit-wp.sh
2020-07-15 17:45:39 +02:00

13 lines
272 B
Bash
Executable File

#!/usr/bin/env sh
# required packages:
# - wget
# - jq
set -e
# There are 2 subreddits "wallpapers" and "wallpaper" the 2nd one is bigger.
SUB="${1:-wallpaper}"
wget -O - "http://www.reddit.com/r/$SUB/top/.json?t=day" 2> /dev/null | jq -r ".data.children[0].data.url"