CSI6203 Scripting Languages

1
CSI6203 Scripting Languages
Assignment: Software Based Solution
Unit Learning Outcomes aligned with this assessment
• ULO 2: Design, develop and deploy scripted software solutions to perform desired tasks.
• ULO 3: Use industry standard scripting languages to create software-based solutions.
Course Learning Outcomes aligned with this assessment
• CLO1:Reflect critically on a complex body of cyber security focused knowledge, research principles and
methods to demonstrate mastery of professional practice.
• CLO 4: Use high level self-management skills to initiate, plan and execute a complex cyber security
research paper or professional project.
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 https://apod.nasa.gov. The image also 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 behaviour (see examples)
The assignment should make use of version control. Be sure to commit your work to a git repository regularly
Example script use:
$ ./nasa.sh -d 2019-01-01
Connecting to nasa.gov…
Downloading “The Sombrero Galaxy in Infrared.jpg”
Finished.
2
$ ./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.
Horizons Spacecraft Passes Ultima Thule
News: New

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.
Horizons Spacecraft Passes Ultima Thule
News: New

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.
3
Marking Rubric

Low Performance Medium
Performance
High Performance
Image
downloading
No attempt
and/or Not
functional
0
Some functionality
implemented. May
not meet all
additional
requirements.
1-4
Image downloading
fully implemented
5
/5
Command-line
options
No attempt
and/or Not
functional
0
Uses some
command line
arguments but could
be improved.
1-4
Command-line
arguments fully
implemented
5
/5
Date handling No/poor attempt
and/or Not
functional
0-4
Most functionality
implemented. May
not meet all
additional
requirements.
5-7
Date handling
correctly meets all
requirements
8-10
/10
Text Processing No/poor attempt
and/or Not
functional
0-4
Most functionality
implemented. May
not meet all
additional
requirements.
5-7
Text is correctly
processed to ensure
all output (including
filenames) is correct,
clear and human
readable.
8-10
/10
Code structure
(functions,
comments,
overall approach)
Poor structure,
missing functions/
comments/
indenting
0-4
Structure is
acceptable, missing
some
functions/comments
or has some
readability concerns
5-7
Script is well
structured and highly
readable/maintainable
8-10
/10
Total /40

Leave a Reply

Your email address will not be published. Required fields are marked *