diff --git a/README.md b/README.md index 36ae53b62..85ddd7f26 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ # ud036_StarterCode -Source code for a Movie Trailer website. + +Source code for a Movie Trailer website dedicated to the Die Hard series. + +Remaining files in Project1_die_hard folder + +FILES +die_hard_movies.py = py file to publish entertainment_centre movies +die_hard_movies.html = file for displaying movies +entertainment_centre = list of movie objects (die_hard films) +media = class for creating new die hard movies + +STEPS TO LAUNCH DIE HARD MOVIE TRAILERS +1. Download the Project1_die_hard folder and save it to the desired location. +2. In terminal (on Mac) navigate to the file path for where you have saved Project1_die_hard +3. Run entertainment_centre.py with cmd $ python entertainment_centre.py +4. This will generate die_hard_movies.html in your browser +5. If you see an error when running entertainment_centre ensure python + is downloaded on your computer (google running python 2.7 on Mac) + +ADD NEW MOVIES +1. Open entertainment_centre +2. Create new object of Movie class +3. Add new object to 'movies' list diff --git a/project1_die_hard/die_hard_movies.html b/project1_die_hard/die_hard_movies.html new file mode 100644 index 000000000..a52a60d6d --- /dev/null +++ b/project1_die_hard/die_hard_movies.html @@ -0,0 +1,134 @@ + + + + + + Fresh Tomatoes! + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +

Die Hard

+
+ +
+ +

Die Harder

+
+ +
+ +

Die Hard with a Vengeance

+
+ +
+ +

Live Free or Die Hard

+
+ +
+ +

A Good Day to Die Hard

+
+ +
+ + diff --git a/fresh_tomatoes.py b/project1_die_hard/die_hard_movies.py similarity index 97% rename from fresh_tomatoes.py rename to project1_die_hard/die_hard_movies.py index 5cd75599c..b8a00fd2a 100644 --- a/fresh_tomatoes.py +++ b/project1_die_hard/die_hard_movies.py @@ -107,7 +107,7 @@ @@ -152,7 +152,7 @@ def create_movie_tiles_content(movies): def open_movies_page(movies): # Create or overwrite the output file - output_file = open('fresh_tomatoes.html', 'w') + output_file = open('die_hard_movies.html', 'w') # Replace the movie tiles placeholder generated content rendered_content = main_page_content.format( diff --git a/project1_die_hard/entertainment_centre.py b/project1_die_hard/entertainment_centre.py new file mode 100644 index 000000000..0a07d0fc3 --- /dev/null +++ b/project1_die_hard/entertainment_centre.py @@ -0,0 +1,44 @@ +# import classes from other files # +import die_hard_movies +import media + +# movie objects # +# Die Hard movie: movie title, poster image and movie trailer +die_hard = media.Movie( + "Die Hard", + "http://horrornews.net/wp-content/uploads/2016/09/Die-Hard-I-DVD.jpg", # NOQA + "https://www.youtube.com/watch?v=-qxBXm7ZUTM" + ) + +# Die Harder movie: movie title, poster image and movie trailer +die_hard_2 = media.Movie( + "Die Harder", + "https://images-na.ssl-images-amazon.com/images/M/MV5BNzM1MzMwNzY2OF5BMl5BanBnXkFtZTgwNzE1MzkyMTE@._V1_.jpg", # NOQA + "https://www.youtube.com/watch?v=OyxfXQ4MGLQ" + ) + +# Die Hard with a Vengeance movie: movie title, poster image and movie trailer +die_hard_3 = media.Movie( + "Die Hard with a Vengeance", + "https://i.jeded.com/i/die-hard-3-die-hard-with-a-vengeance.15819.jpg", # NOQA + "https://www.youtube.com/watch?v=gQ0uSh2Hgcs" + ) + +# Live Free of Die Hard movie: movie title, poster image and movie trailer +die_hard_4 = media.Movie( + "Live Free or Die Hard", + "https://i.pinimg.com/originals/b1/97/90/b197904bb75a1c3c9f55046083a94fa4.jpg", # NOQA + "https://www.youtube.com/watch?v=xqjICXgcsZM" + ) + +# A Good Day to Die Hard movie: movie title, poster image and movie trailer +die_hard_5 = media.Movie( + "A Good Day to Die Hard", + "http://screencrush.com/files/2012/12/die_hard_5_poster.jpg", # NOQA + "https://www.youtube.com/watch?v=L1-_JtvbqRk" + ) +# list of movies # +movies = [die_hard, die_hard_2, die_hard_3, die_hard_4, die_hard_5] + +# calls open_movies_page to generate die_hard_movies.htlm file +die_hard_movies.open_movies_page(movies) diff --git a/project1_die_hard/media.py b/project1_die_hard/media.py new file mode 100644 index 000000000..f05d15605 --- /dev/null +++ b/project1_die_hard/media.py @@ -0,0 +1,10 @@ +# class to create a new movie entry with movie title, +# poster_image_url, and trailer_youtube_url + + +class Movie(): + def __init__(self, movie_title, poster_image_url, trailer_youtube_url): + """ This docstring explains the constructor method """ + self.title = movie_title + self.poster_image_url = poster_image_url + self.trailer_youtube_url = trailer_youtube_url