Skip to content

Instantly share code, notes, and snippets.

@shirish87
Created April 10, 2016 09:05
Show Gist options
  • Save shirish87/d6e0f9fcd9787c86a043374a207eeb51 to your computer and use it in GitHub Desktop.
Save shirish87/d6e0f9fcd9787c86a043374a207eeb51 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
wget -O /tmp/apod.txt http://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss
urls=$(grep -o '<enclosure [^>]*>' /tmp/apod.txt | grep -o 'http[.]*://[^\"]*')
for url in $urls
do
if [ ! -z "$url" ]
then
echo "Downloading $url"
wget -N $url
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment