Fixed user agent

master
Keith Irwin 2021-07-06 23:13:23 -06:00
parent 56f6f480c6
commit ef3316a81c
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 5 additions and 3 deletions

View File

@ -18,6 +18,9 @@
#
# Vars
USER_AGENT="reddit-wallpaper https://gitea.gf4.pw/ki9/reddit-wallpaper"
# Parse args
if [ "$#" != "2" ]; then
echo "USAGE: $0 <monitor> <subreddit>"
@ -28,8 +31,7 @@ monitor="$1"
# Get top image url
url=$(
curl --silent \
--user-agent "Pulling images for my desktop background. Contact: u/DrKeith" \
curl --silent --user-agent "$USER_AGENT" \
"https://www.reddit.com/r/$subreddit/top/.xml?t=day&limit=1" |\
egrep -o '<content.*>.*</content' |\
egrep -o 'href=.*?' |\
@ -47,7 +49,7 @@ fi
echo "getting $url"
# Download image
curl --silent "$url" > /tmp/wallpaper
curl --silent --user-agent "$USER_AGENT" "$url" > /tmp/wallpaper
# Set wallpaper
# xfce >4.12.3