Fixed user agent
parent
56f6f480c6
commit
ef3316a81c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue