This commit is contained in:
sa 2022-02-01 01:06:55 -05:00
parent 90ddf52838
commit 83290679a7
5 changed files with 192 additions and 0 deletions

2
footer Normal file
View File

@ -0,0 +1,2 @@
</body>
</html>

9
header Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="Sean" content="03/25/2021">
<title>Seans Static Site Generator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

51
index.html Normal file
View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="Sean Smith" content="03/25/2021">
<title>Sean Smith Midterm</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Titanic</h1>
<p>101-year-old Rose DeWitt Bukater tells the story of her life aboard the Titanic, 84 years later. A young Rose boards the ship with her mother and fiancé. Meanwhile, Jack Dawson and Fabrizio De Rossi win third-class tickets aboard the ship. Rose tells the whole story from Titanic's departure through to its death—on its first and last voyage—on April 15, 1912.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/9xjZS2rlVxm8SFx8kPC3aIGCOYQ.jpg"</img>
<p>Release Date: 1997-11-18</p>
<h1>Titanic II</h1>
<p>On the 100th anniversary of the original voyage, a modern luxury liner christened \"Titanic 2,\" follows the path of its namesake. But when a tsunami hurls an ice berg into the new ship's path, the passengers and crew must fight to avoid a similar fate.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/3bhv6sf3Q8D3tbUvtPCCh3vdYyA.jpg"</img>
<p>Release Date: 2010-08-07</p>
<h1>Titanic</h1>
<p>Unhappily married, Julia Sturges decides to go to America with her two children on the unsinkable Titanic. Her husband, Richard also arranges passage on the luxury liner so as to have custody of their two children. All this fades to insignificance once the ship hits an iceberg.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/22Fh4UoxP6ejL2IFws76TJ8oYlj.jpg"</img>
<p>Release Date: 1953-04-11</p>
<h1>Titanic: 100 Years On</h1>
<p>The \"unsinkable\" floating palace set sail from Southampton on 10th April 1912 on her maiden voyage to New York. An iceberg ended this monumental journey 5 days later. Only 705 of the passengers and crew survived. This program features an exclusive look at the Sea City Museum Titanic Exhibit in Southampton, interviews from both survivors and the cast of the blockbuster film.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/uAaXfaJpKjmsA3F1KgowcRJPKPM.jpg"</img>
<p>Release Date: 2012-06-01</p>
<h1>Aliens vs. Titanic</h1>
<p>Offering only the finest amenities, the TITAN 1C space-cruiser is considered the most luxurious star-liner ever built. Future spring-breakers on board are excited to be touring through space with some of the worlds elite. However, a sudden meteor storm smashes into the hull, and a deadly biological alien life form is let loose on the ship. Seeking a suitable host, the retrovirus successfully merges with some the passengers, transforming them into seemingly invincible predators with the “touch of death”. As the ship is destroyed, the surviving passengers crash on a remote planet, and they learn that one of them is “infected”. They must quickly band together before it has a chance to slaughter them all.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/blREOd05hyvbiA3Qc6BqCJ7unvC.jpg"</img>
<p>Release Date: 2017-09-18</p>
<h1>Nazi Titanic</h1>
<p>During a bizarre chapter of WWII, Nazi propaganda minister Joseph Goebbels decided to make a movie based on the sinking of the Titanic. This epic film was so large in scale that the Nazis were forced to divert men, material and ships from the war effort in order to complete it. Titanic was filmed aboard cruise ship SS Cap Arcona in the Baltic Sea. The movies director Herbert Selpin was arrested by the Gestapo over comments he made about the ships crew and he was questioned by Goebbels. Selpin was found dead the next day in his cell. The Gestapos verdict was suicide. Titanic never received the impressive premiere that Goebbels intended, being first shown in Nazi-occupied Paris in 1943. We reveal this little known but fascinating story by looking at the making of the film, as well as the fate of the German ship Cap Arcona.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/pmCnVAP0dQumyDMgCnzEgnpMt1g.jpg"</img>
<p>Release Date: 2012-04-14</p>
<h1>Raise the Titanic</h1>
<p>To obtain a supply of a rare mineral, a ship raising operation is conducted for the only known source, the Titanic.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/beYNLj44FOdV47tomXuJyPkvCKl.jpg"</img>
<p>Release Date: 1980-08-01</p>
<h1>Titanic 2000</h1>
<p>The luxury liner Titanic 2000 has set sail on its maiden voyage, and one of the passengers is the vampire Vladamina. Vladamina is searching for a woman she can turn into a vampire queen, and frustrated rock groupie Shari looks to be a perfect target. As various people get seduced and/or killed as the liner continues on its doomed voyage, Shari must chose between eternity as a living dead sex slave or a frigid grave at the bottom of the ocean.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/w8KzGphSGIDcUhHmdRbqxYXI8ke.jpg"</img>
<p>Release Date: 1999-01-01</p>
<h1>Titanic: The Aftermath</h1>
<p>Explores what happened after the Titanic sank: the lives the disaster affected and the changes it brought to sea travel.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/3LqoUNnbHAolDXI2pLPEXko9wFt.jpg"</img>
<p>Release Date: 2012-04-01</p>
<h1>Inside the Titanic</h1>
<p>An ambitious factual drama that reveals moment by moment exactly how the Titanic sank, telling the untold stories of the engineers and stokers who battled the icy water.</p>
<img src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/jDHeorRWLuzyXSUGVX47OSdWvVM.jpg"</img>
<p>Release Date: 2012-03-22</p>
</body>
</html>

82
sitegenerator.sh Executable file
View File

@ -0,0 +1,82 @@
#!/bin/sh
# Written by Sean Smith
# Date: 03/25/2021
# This program takes one search term and uses the MovieDB API to return
# relevant information on the top 10 results. The program parses the data and compiles it into
# an HTML document named index.html
# This will run on any system with the GNU core utils (almost every unix system)
# If you are having trouble running it then run "chmod +x midterm.sh" to give the file
# execute permission
#take one arg as the search term
SEARCH=$1
if [ $# -eq 0 ]
then
echo "This program requires an argument!"
echo "Please enter a search term with no spaces or special characters."
echo "EXAMPLE: ./midterm.sh titanic"
exit 1
fi
#query the api
wget "https://api.themoviedb.org/3/search/movie?api_key=1f2944e277cd20849744f1b752deb3f4&language=en-US&page=1&include_adult=false&query="$SEARCH
#rename the JSON file
mv "movie?api_key=1f2944e277cd20849744f1b752deb3f4&language=en-US&page=1&include_adult=false&query="$SEARCH result.json
#format the JSON file and break it into seperate files for each search result
sed -i 's/,"/,\n"/g' result.json
sed -i 's/},{/}\n\nSPLITSYMBOL\n\n{/g' result.json
csplit result.json --suppress-matched '/SPLITSYMBOL/' {*}
CURRENT=0
while [ $CURRENT -le 9 ]
do
#replace JSON with html tags
sed -i 's/"original_title":"/<h1>/g' xx0$CURRENT
sed -i 's/"poster_path":"/<img src="https:\/\/www.themoviedb.org\/t\/p\/w600_and_h900_bestv2/g' xx0$CURRENT
sed -i 's/"release_date":"/<p>Release Date: /g' xx0$CURRENT
sed -i 's/"overview":"/<p>/g' xx0$CURRENT
#remove end of line ,"
sed -i 's/",//g' xx0$CURRENT
#close html tags
sed -i -e '/<h1>/s/$/<\/h1>/' xx0$CURRENT
sed -i -e '/<p>/s/$/<\/p>/' xx0$CURRENT
sed -i -e '/<img/s/$/"<\/img>/' xx0$CURRENT
#remove unneeded lines
sed -i 's/^[^<].*//g' xx0$CURRENT
sed -i '/^[[:space:]]*$/d' xx0$CURRENT
CURRENT=$((CURRENT+1))
done
#remove previous search result page
rm index.html
#generate new search result page
cat header xx00 xx01 xx02 xx03 xx04 xx05 xx06 xx07 xx08 xx09 footer > index.html
#remove temporary files
CURRENT=0
while [ $CURRENT -le 9 ]
do
rm xx0$CURRENT
CURRENT=$((CURRENT+1))
done
while [ $CURRENT -le 19 ]
do
rm xx$CURRENT
CURRENT=$((CURRENT+1))
done
echo "index.html has been generated in this directory"
echo "Done!"
exit 1

48
style.css Normal file
View File

@ -0,0 +1,48 @@
body {
margin: 0 auto;
max-width: 700px;
padding: 20px;
background-color: #f4f4f4;
color: #444444;
}
a {
color: #cc6600;
}
a:visited {
color: #993300;
}
a:hover {
color: #990000;
}
body,
input,
button {
font-family: "Noto Serif", serif;
font-size: 20px;
}
hr,
h1,
h2 {
margin-top: 60px;
}
hr {
border: 0;
}
li {
padding: 5px 0;
}
p img,
table {
width: 100%;
}
p {
clear: both;
}