Create a gist now

Instantly share code, notes, and snippets.

anonymous /randomNasaPicsture.sh Secret
Created Sep 2, 2016

What would you like to do?
while true; do
curl -s -q http://apod.nasa.gov/apod/archivepix.html | grep -oP 'href=\"ap.+\"' | shuf -n 1 | sed 's/href=\"//' | sed 's/\"//' | awk '{print "http://apod.nasa.gov/apod/"$1}' | xargs curl -s -q | grep -oP 'href=\"(image.+)\"' | sed 's/href=\"//' | sed 's/\"//' | awk '{print "http://apod.nasa.gov/"$1}' | xargs curl -o ~/.bin/desktop_picture.jpg
sleep 10m
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment