This isn't what your after but it's similar and I like it
This is the script I use to grab pics from the NASA astronomy picture of the day website
http://antwrp.gsfc.nasa.gov/apod/astropix.html
I cron it to run each morning before I get in. Run it once and set your desktop background to be the downloaded picture. Some desktops will auto detect that the picture has changed but others will not notice unless you re-login or refresh the desktop. Windows is like that lol.
This is actually a slightly tweaked version of my script as it used some of my production logging code, which I removed as it's unnecessarily bulky for such a little script. Change some of the >/dev/null to >> $LOGFILE if you need some extra debugging.
Looking at it if I wrote it now it'd likely be quite different lol.
On the rare occasions they don't have a jpg it doesn't download, as it'll likely be a video.
Code:
#!/bin/bash
#
# Changes my desktop pic each day
# DarthWavyBashScripts@wavy.org
#
# desktop.sh
# Copyright (C) 2004-2008 David Stringer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# location of pic and log
cd /home/david/scripts/desktop
LOGFILE=/home/david/scripts/desktop/desktop.log
echo "Starting desktop.sh" >> $LOGFILE
echo "$(date)" >> $LOGFILE
picname=`wget -q -O - http://antwrp.gsfc.nasa.gov/apod/astropix.html | grep '<IMG SRC="' | head -1 | awk -F\" '{ print $2 }' 2>>/dev/null`
echo " picname=$picname" >> $LOGFILE
if echo $picname | egrep '.jpg' >/dev/null
then
echo "Grabbing $picname" >> $LOGFILE
wget -q -O downloaded.jpg http://antwrp.gsfc.nasa.gov/apod/$picname 2>>/dev/null
mv -f downloaded.jpg desktop.jpg 2>>/dev/null
fi
echo "Complete" " " >> $LOGFILE