reddit wallpaper fix

This commit is contained in:
Niklas 2020-07-15 17:45:39 +02:00
parent 647415fad1
commit b00db4983d
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -2,7 +2,7 @@
SCRIPT=$(readlink -f "$0") SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") SCRIPTPATH=$(dirname "$SCRIPT")
URL=$($SCRIPTPATH/reddit-wp.sh) URL=$($SCRIPTPATH/reddit-wp.sh $1)
NAME=$(basename "$URL") NAME=$(basename "$URL")
FILENAME=~/pictures/wallpapers/"$NAME" FILENAME=~/pictures/wallpapers/"$NAME"
wget "$URL" -nc -O "$FILENAME" wget "$URL" -nc -O "$FILENAME"