You are not logged in.

#1 2007-12-26 00:46:15

smurnjiff
Member
Registered: 2007-06-25
Posts: 211

Downloading Images from APOD with BASH

So far, I have managed to successfully download the latest picture from the APOD website (Astronomy Picture of the Day).  However, I do not know how I would manage to extract the description below the image. For example, http://antwrp.gsfc.nasa.gov/apod/ap071225.html

The provided script downloads the latest image and saves it as apod.jpg
(improvements to the script are welcome)

#!/bin/bash
DATE='/bin/date +%y%m%d'
wget http://antwrp.gsfc.nasa.gov/apod/ap`$DATE`.html -O- 2> /dev/null |
grep -m 1 jpg | 
sed -e 's/<//' -e 's/>//' -e 's/.*=//' -e 's/"//g' -e 's/^/http:\/\/antwrp.gsfc.nasa.gov\/apod\//' |
wget -i- -O apod.jpg

How would I download the accompanying description (using BASH if applicable)?

Offline

#2 2012-10-05 09:25:41

potat
Member
Registered: 2012-02-15
Posts: 1

Re: Downloading Images from APOD with BASH

Just want to thank you for this. It still works! I am thinking of trying to pull the description text and overlay it using imagemagick.

Offline

Board footer

Powered by FluxBB