Essay Help Services

CSI6203 | Scripting Languages Assignment | IT

Home Recent Questions CSI6203 | Scripting Languages Assignment | IT

Task:

You have been tasked with creating a script to automatically retrieve information from the North American Space Association (NASA) website.

Each day, NASA posts a new astronomy image to includes a title for the image, explanation text for the image and credits for the image’s origin. Your task is to write a bash script that can be used to access this information. The script should work as follows:

• Given a specific date, the script should be able to download the image posted on that date

• Given a specific date, the script should be able to download the title, explanation text and credits

• Given two dates, the script should be able to download all images posted between the two dates (maximum of 10 images at a time)


Additional Requirements:

• If the NASA website is unavailable, the script should print an appropriate error message and exit with a status of 1

• Downloaded images should be named after the title of the image (eg. "The Sombrero Galaxy in Infrared.jpg"

• If a filename is specified, the image or output should be saved to that file. If no file is specified, the image should be downloaded to the current directory

• The script should use command-line options to control behavior (see examples)

The assignment should make use of version control. Be sure to commit your work to a git repository regularly

Example script 

$ ./nasa.sh -d 2019-01-01 Connecting to nasa.gov...

Downloading "The Sombrero Galaxy in Infrared.jpg"

Finished.

$ ./nasa.sh --type explanation --date 2019-01-01 Connecting to nasa.gov...

This floating ring is the size of a galaxy. In fact, it is a galaxy -- or at least part of one: the photogenic Sombrero Galaxy, one of the largest galaxies in the nearby Virgo Cluster of Galaxies. The dark band of dust that obscures the mid-section of the Sombrero Galaxy in optical light actually glows brightly in infrared light. The featured image, digitally sharpened, shows the infrared glow, recently recorded by the orbiting Spitzer Space Telescope, superposed in false-color on an existing image taken by NASA's Hubble Space Telescope in optical light. The Sombrero Galaxy, also known as M104, spans about 50,000 light years across and lies 28 million light-years away. M104 can be seen with a small telescope in the direction of the constellation Virgo. News: New Horizons Spacecraft Passes Ultima Thule

Finished.

$ ./nasa.sh -t details -d 2019-01-01 Connecting to nasa.gov...

TITLE: The Sombrero Galaxy in Infrared EXPLANATION:

This floating ring is the size of a galaxy. In fact, it is a galaxy -- or at least part of one: the photogenic Sombrero Galaxy, one of the largest galaxies in the nearby Virgo Cluster of Galaxies. The dark band of dust that obscures the mid-section of the Sombrero Galaxy in optical light actually glows brightly in infrared light. The featured image, digitally sharpened, shows the infrared glow, recently recorded by the orbiting Spitzer Space Telescope, superposed in false-color on an existing image taken by NASA's Hubble Space Telescope in optical light. The Sombrero Galaxy, also known as M104, spans about 50,000 light years across and lies 28 million light-years away. M104 can be seen with a small telescope in the direction of the constellation Virgo. News: New Horizons Spacecraft Passes Ultima Thule

IMAGE CREDIT: R. Kennicutt (Steward Obs.) et al., SSC, JPL, Caltech, NASA Finished.

$ ./nasa.sh --range 2019-01-01 2019-01-04 Connecting to nasa.gov...

Downloading "The Sombrero Galaxy in Infrared.jpg" Downloading "The Orion Nebula in Infrared from WISE.jpg" Downloading "Ultima and Thule.png"

Downloading "Ultima Thule Rotation Gif.gif"

Finished.

Similar Posts

Order Now

Latest Reviews

Facebook

Payments And Security